if(tactile==null||typeof(tactile)!="object"){
    var tactile={};
    
    tactile.version="1.1-201207021030";
    tactile.pageLayout=false;
}
if(tactile.c==null||typeof(tactile.c)!="object"){
    tactile.c={};
    
}
if(!Array.prototype.indexOf){
    Array.prototype.indexOf=function(c,d){
        var a,b=d||0;
        for(a=b;a<this.length;++a){
            if(this[a]===c){
                return a;
            }
        }
        return -1;
    };

}
if(!Array.prototype.contains){
    Array.prototype.contains=function(b){
        for(var a=0;a<this.length;a++){
            if(this[a]===b){
                return true;
            }
        }
        return false;
    };

}
if(!Array.prototype.forEach){
    Array.prototype.forEach=function(c,d){
        var a,b=d||window;
        for(a=0,j=this.length;a<j;++a){
            c.call(b,this[a],a,this);
        }
        };
    
}
if(!Array.prototype.every){
    Array.prototype.every=function(c,d){
        var a,b=d||window;
        for(a=0,j=this.length;a<j;++a){
            if(!c.call(b,this[a],a,this)){
                return false;
            }
        }
        return true;
    };

}
if(!Array.prototype.some){
    Array.prototype.some=function(c,d){
        var a,b=d||window;
        for(a=0,j=this.length;a<j;++a){
            if(c.call(b,this[a],a,this)){
                return true;
            }
        }
        return false;
    };

}
if(!Array.prototype.map){
    Array.prototype.map=function(e,f){
        var c,b=[],d=f||window;
        for(c=0,j=this.length;c<j;++c){
            b.push(e.call(d,this[c],c,this));
        }
        return b;
    };
    
}
if(!Array.prototype.filter){
    Array.prototype.filter=function(f,g){
        var d,c=this.length,b=[],e=g||window;
        for(d=0;d<c;++d){
            if(!f.call(e,this[d],d,this)){
                continue;
            }
            b.push(this[d]);
        }
        return b;
    };
    
}
if(!Array.prototype.lastIndexOf){
    Array.prototype.lastIndexOf=function(c,d){
        var a,b=d||this.length;
        if(b>=this.length){
            b=this.length;
        }
        if(b<0){
            b=this.length+d;
        }
        for(a=b;a>=0;--a){
            if(this[a]===c){
                return a;
            }
        }
        return -1;
    };

}
if(!Array.prototype.remove){
    Array.prototype.remove=function(a){
        var b=this.indexOf(a);
        if(b!=-1){
            this.splice(b,1);
        }
    };
    
}
document.getElementsByAttribute=function(c,g,b,a){
    var e=[];
    if(b==null){
        b=this;
    }
    if(a==null){
        a="*";
    }
    var d=b.getElementsByTagName(a);
    for(var f=0;f<d.length;f++){
        if(d[f].hasAttribute(c)){
            if(g){
                if(d[f].getAttribute(c)==g){
                    e.push(d[f]);
                }
            }else{
            e.push(d[f]);
        }
    }
    }
return e;
};

document.getFirstBodyChild=function(){
    var a=document.body;
    if(a.firstElementChild){
        return a.firstElementChild;
    }
    if(a.firstChild&&a.firstChild.nodeType===1){
        return a.firstChild;
    }
    return undefined;
};

if(!document.getElementsByClassName){
    document.getElementsByClassName=function(a){
        return tactile.c.E.getElementsByClassName(document,a);
    };
    
}
document.getAll=function(n,o){
    var p=new Array();
    var f=n.split(",");
    var d,a,b;
    var l="";
    d="";
    var c=o||document;
    for(var h=0;h<f.length;h++){
        if(f[h].indexOf(".")==0){
            b=new Array();
            if(c.querySelectorAll){
                b=c.querySelectorAll(f[h]);
                for(var e=0;e<b.length;e++){
                    p.push(b[e]);
                }
                }else{
            if(d!=""){
                l=",";
            }
            d+=l+f[h].substr(1);
        }
    }else{
        if(f[h].indexOf("#")==0){
            b=document.getElementById(f[h].substr(1));
            if(b&&b!=null){
                p.push(b);
            }
        }
    }
}
if(d!=""){
    b=tactile.c.E.getElementsByClassName(c,d);
    if(b&&b.length>0){
        for(var g=0;g<b.length;g++){
            p.push(b[g]);
        }
        }
    }
return p;
};

if(!Function.prototype.bind){
    Function.prototype.bind=function(b){
        var a=this;
        return function(){
            return a.apply(b,arguments);
        };
    
    };

}
Function.prototype.extend=function(a){
    if(typeof a==="object"){
        for(var b in a){
            if(a.hasOwnProperty(b)){
                this.prototype[b]=a[b];
            }
        }
        }
    };

if(!String.prototype.ltrim){
    String.prototype.ltrim=function(a){
        a=a||"\\s";
        return this.replace(new RegExp("^["+a+"]+","g"),"");
    };
    
}
if(!String.prototype.rtrim){
    String.prototype.rtrim=function(a){
        a=a||"\\s";
        return this.replace(new RegExp("["+a+"]+$","g"),"");
    };
    
}
if(!String.prototype.trim){
    String.prototype.trim=function(a){
        return this.ltrim(a).rtrim(a);
    };
    
}
tactile.c.AppInfo={
    internalPath:(function(){
        var a,b;
        if(typeof nbdevice==="object"){
            if(nbdevice.internalapppath){
                a=nbdevice.internalapppath;
            }
            if(nbdevice.internalpath){
                b=nbdevice.internalpath;
            }
            if(b===undefined||b===null||b.length===0){
                b="nbinternal";
            }
            if(!(b.indexOf("http")===0)){
                b=a+b;
            }
        }
        return b;
    })()
    };
    
tactile.c.Error=function(a){
    this.name="tactile.c.Error";
    this.message="A error has occured !";
    this.number=900;
};

tactile.c.C={};
    
tactile.c.C.getCookie=function(c){
    if(document.cookie.length>0){
        var a=document.cookie.indexOf(c+"=");
        if(a!==-1){
            a=a+c.length+1;
            var b=document.cookie.indexOf(";",a);
            if(b===-1){
                b=document.cookie.length;
            }
            return unescape(document.cookie.substring(a,b));
        }
    }
    return"";
};

tactile.c.C.setCookie=function(d,c,a){
    var b=new Date();
    b.setDate(b.getDate()+a);
    document.cookie=d+"="+escape(c)+((a===null)?"":";expires="+b.toGMTString());
};

tactile.c.C.deleteCookie=function(a){
    if(this.getCookie(a)){
        document.cookie=a+"=; expires=Thu, 01-Jan-70 00:00:01 GMT;";
    }
};

tactile.c.D={
    type:((typeof nbdevice==="object")&&nbdevice.devicetype)?nbdevice.devicetype:"",
    displayCategory:((typeof nbdevice==="object")&&nbdevice.tactiledisplaycategory)?nbdevice.tactiledisplaycategory:"",
    os:(function(){
        var g={};
        
        g.platform="unknown";
        g.version=0;
        g.isTouch=c();
        if(window.navigator){
            var b=[{
                id:"android",
                ver:"android[/|\\s]([0-9].[0-9])"
            },{
                id:"bada",
                ver:"bada/([0-9])"
            },{
                id:"webos",
                ver:"webos/([0-9].[0-9])"
            },{
                id:"blackberry",
                ver:"blackberry[0-9]{4}?/([0-9].[0-9])"
            }];
            var h=[{
                id:"iphone",
                ver:"iphone os ([0-9])"
            },{
                id:"ipod",
                ver:"os ([0-9])"
            },{
                id:"ipad",
                ver:"os ([0-9])"
            },{
                id:"mac",
                ver:null
            },{
                id:"win",
                ver:null
            }];
            var f=window.navigator.userAgent.toLowerCase();
            for(var e=0;e<b.length;e++){
                if(f.indexOf(b[e].id)!=-1){
                    g.platform=b[e].id;
                    if(b[e].ver!==null&&f.match(RegExp(b[e].ver))!=-1){
                        g.version=RegExp.$1;
                    }
                    break;
                }
            }
            if(g.platform=="unknown"){
            var a=window.navigator.platform.toLowerCase();
            for(var d=0;d<h.length;d++){
                if(a.indexOf(h[d].id)!=-1){
                    if(h[d].id==="iphone"||h[d].id==="ipod"||h[d].id==="ipad"){
                        g.platform="ios";
                    }
                    if(h[d].ver!==null&&f.match(RegExp(h[d].ver))!=-1){
                        g.version=RegExp.$1;
                    }
                    break;
                }
            }
            if(g.platform=="unknown"){
            g.platform=a;
        }
    }
    }
function c(){
    if(typeof nbdevice==="object"&&nbdevice.tactiletouchapi){
        return(nbdevice.tactiletouchapi=="Touch");
    }
    try{
        document.createEvent("TouchEvent");
        return true;
    }catch(i){
        return false;
    }
}
return g;
})(),
browser:(function(){
    var n={},c={},q=document.createElement("feature"),i=q.style,g={
        webkit:"-webkit-",
        opera:"-o-",
        netfront:"",
        firefox:"-moz-",
        iemobile:"-ms-",
        msie:"-ms"
    };
    
    cssborderradius="cssborderradius";
    cssanimations="cssanimations",csstransitions="csstransitions",csstransforms="csstransforms",csstransforms3d="csstransforms3d";
    n.style={};
    
    n.cssprefix="";
    n.name="unknown";
    n.transitionEndEvent="";
    var o=tactile.c.C.getCookie("emvcc");
    n.canCookie=(o=="")?false:true;
    n.adressbarheight=undefined;
    if((typeof nbdevice==="object")&&(nbdevice.tactileadressbarheight!==undefined)){
        n.adressbarheight=nbdevice.tactileadressbarheight;
    }
    if(window.navigator){
        var l=["webkit","opera","netfront","firefox","iemobile","msie"];
        var a=window.navigator.userAgent.toLowerCase();
        for(var d=0;d<l.length;d++){
            if(a.indexOf(l[d])!=-1){
                n.name=l[d];
                n.cssprefix=g[n.name];
            }
        }
        }
    var p=({}).hasOwnProperty,r;
if(typeof p!=="undefined"&&typeof p.call!=="undefined"){
    r=function(k,f){
        return p.call(k,f);
    };

}else{
    r=function(k,f){
        return((f in k)&&typeof k.constructor.prototype[f]==="undefined");
    };

}
function h(s,k){
    for(var f in k){
        if(i[k[f]]!==undefined){
            n.style[s]=k[f];
            return true;
        }
    }
    }
    function b(s){
    var k=s.charAt(0).toUpperCase()+s.substr(1),f=[s,"Webkit"+k,"Moz"+k,"O"+k,"ms"+k];
    return !!h(s,f);
}
c[cssborderradius]=function(){
    return b("borderRadius");
};

c[cssanimations]=function(){
    return b("animationName");
};

c[csstransitions]=function(){
    if(b("transitionProperty")){
        b("transitionDuration");
        b("transitionTimingFunction");
        b("transitionDelay");
        return true;
    }else{
        return false;
    }
};

c[csstransforms]=function(){
    return !!h("transformProperty",["WebkitTransform","MozTransform","OTransform","msTransform"]);
};

c[csstransforms3d]=function(){
    var f=!!h("perspectiveProperty",["WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);
    return f;
};

for(var e in c){
    if(r(c,e)){
        n[e.toLowerCase()]=c[e]();
    }
}
q=null;
return n;
})(),
screen:{
    getWidth:function(){
        if(typeof netbiscuits!=="undefined"&&netbiscuits.screen!=="undefined"&&netbiscuits.screen.resizeEvent!=="undefined"){
            return netbiscuits.screen.getWidth();
        }else{
            var a=320;
            if(tactile.c.D.browser.name==="webkit"){
                a=document.documentElement.clientWidth;
            }else{
                if(typeof(window.innerWidth)=="number"){
                    a=window.innerWidth;
                }else{
                    if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
                        a=document.documentElement.clientWidth;
                    }else{
                        if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
                            a=document.body.clientWidth;
                        }else{
                            if(window.screen.availWidth){
                                a=window.screen.availWidth;
                            }
                        }
                    }
            }
    }
return a;
}
},
getHeight:function(){
    if(typeof netbiscuits!=="undefined"&&netbiscuits.screen!=="undefined"&&netbiscuits.screen.resizeEvent!=="undefined"){
        return netbiscuits.screen.getHeight();
    }else{
        var a=480;
        if(tactile.c.D.browser.name==="webkit"){
            a=document.documentElement.clientHeight;
        }else{
            if(typeof(window.innerWidth)=="number"){
                a=window.innerHeight;
            }else{
                if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
                    a=document.documentElement.clientHeight;
                }else{
                    if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
                        a=document.body.clientHeight;
                    }else{
                        if(window.screen.availWidth){
                            a=window.screen.availHeight;
                        }
                    }
                }
        }
}
return a;
}
},
updateOrientation:function(){
    if(tactile.c.D.screen.getHeight()>tactile.c.D.screen.getWidth()){
        document.body.className="portrait";
    }else{
        document.body.className="landscape";
    }
}
}
};

setTimeout(function(){
    if(window.addEventListener){
        var b=document.createElement("div");
        var a=function(c){
            tactile.c.D.browser.transitionEndEvent=c.type;
            this.removeEventListener("webkitTransitionEnd",arguments.callee);
            this.removeEventListener("OTransitionEnd",arguments.callee);
            this.removeEventListener("transitionend",arguments.callee);
            this.removeEventListener("transitionEnd",arguments.callee);
        };
        
        b.setAttribute("style","position:absolute;top:0px;transition:top 1ms ease;-webkit-transition:top 1ms ease;-moz-transition:top 1ms ease;-o-transition:top 1ms ease");
        b.addEventListener("webkitTransitionEnd",a,false);
        b.addEventListener("OTransitionEnd",a,false);
        b.addEventListener("transitionend",a,false);
        b.addEventListener("transitionEnd",a,false);
        document.documentElement.appendChild(b);
        setTimeout(function(){
            b.style.top="100px";
            setTimeout(function(){
                b.parentNode.removeChild(b);
                b=a=null;
            },100);
        },0);
    }
},10);
tactile.c.E={
    isHTMLElement:function(a){
        if(a&&a!==null){
            if(typeof HTMLElement==="object"){
                return(a instanceof HTMLElement||(a&&a.nodeType&&a.nodeType==1));
            }else{
                return(a&&a.nodeType&&a.nodeType==1);
            }
        }
        return false;
},
getOffsetLeft:function(b){
    var a=0;
    if(b.offsetParent){
        while(b.offsetParent){
            a+=b.offsetLeft;
            b=b.offsetParent;
        }
    }else{
    if(b.x){
        a+=b.x;
    }
}
return a;
},
getOffsetTop:function(b){
    var a=0;
    if(b.offsetParent){
        while(b.offsetParent){
            a+=b.offsetTop;
            b=b.offsetParent;
        }
    }else{
    if(b.y){
        a+=b.y;
    }
}
return a;
},
getChildByTagname:function(a,c){
    if(c){
        if(a.getElementsByTagName){
            var b=a.getElementsByTagName(c);
            if(b&&b.length>0){
                return b[0];
            }
        }
    }
},
getTagName:function(b){
    var a;
    a=b.tagName;
    if(!a){
        a=b.nodeName;
    }
    if(a.toUpperCase){
        a=a.toUpperCase();
    }
    return a;
},
hasClass:function(d,c){
    var a,b;
    a=d.className;
    b=a.split(" ");
    if(a&&a.length>0){
        return b.contains(c);
    }
    return false;
},
addClass:function(d,c){
    if(d){
        var a,b;
        a=d.className;
        b=a.split(" ");
        if(a&&a.length>0){
            b=a.split(" ");
            if(!b.contains(c)){
                d.className=a+" "+c;
            }
        }else{
        d.className=c;
    }
    return d.className;
}else{
    return null;
}
},
removeClass:function(e,d){
    if(e){
        var a,c,f;
        a=e.className;
        c=a.split(" ");
        f="";
        for(var b=0;b<c.length;b++){
            if(c[b]!=d){
                if(f.length>0){
                    f+=" "+c[b];
                }else{
                    f+=c[b];
                }
            }
        }
        if(f.length>0){
    e.className=f;
}else{
    e.removeAttribute("class");
}
return e.className;
}else{
    return null;
}
},
getCurrStyle:function(a,c){
    if(a.currentStyle){
        return a.currentStyle[c];
    }else{
        if(window.getComputedStyle){
            var b;
            b=window.getComputedStyle(a,false);
            if(b==null){
                b=window.getComputedStyle(a,null);
            }
            if(tactile.c.D.browser.name==="webkit"&&c==="margin-right"){
                return b.getPropertyValue("margin-left");
            }
            return b.getPropertyValue(c);
        }else{
            if(document.defaultView&&document.defaultView.getComputedStyle){
                return document.defaultView.getComputedStyle(a,"")[c];
            }else{
                return a.style[c];
            }
        }
    }
},
getStyleValue:function(d,e){
    var c,b,a;
    a=0;
    c=tactile.c.E.getCurrStyle(d,e);
    if(c!==undefined){
        b=c.indexOf("px");
        if(b>-1){
            a+=Number(c.substring(0,b));
        }
    }
    return a;
},
getHorizontalMargin:function(c){
    var b,a,e,d;
    e=0;
    b=tactile.c.E.getCurrStyle(c,"margin-left");
    if(b!==undefined){
        a=b.indexOf("px");
        if(a>-1){
            e+=Number(b.substring(0,a));
        }
    }
    b=tactile.c.E.getCurrStyle(c,"margin-right");
if(b!==undefined){
    a=b.indexOf("px");
    if(a>-1){
        e+=Number(b.substring(0,a));
    }
}
return e;
},
getVerticalMargin:function(c){
    var b,a,e,d;
    e=0;
    b=tactile.c.E.getCurrStyle(c,"margin-top");
    if(b!==undefined){
        a=b.indexOf("px");
        if(a>-1){
            e+=Number(b.substring(0,a));
        }
    }
    b=tactile.c.E.getCurrStyle(c,"margin-bottom");
if(b!==undefined){
    a=b.indexOf("px");
    if(a>-1){
        e+=Number(b.substring(0,a));
    }
}
return e;
},
getOffsetMarginLeft:function(b){
    var a=0;
    if(b.offsetParent){
        while(b.offsetParent){
            a+=tactile.c.E.getStyleValue(b,"margin-left")+tactile.c.E.getStyleValue(b,"border-left-width");
            b=b.offsetParent;
        }
    }
    return a;
},
setOpacity:function(b,a){
    if(b.style.opacity!=undefined){
        b.style.opacity=(a/100);
    }else{
        if(b.style.MozOpacity!=undefined){
            b.style.MozOpacity=(a/100);
        }else{
            if(b.style.KhtmlOpacity!=undefined){
                b.style.KhtmlOpacity=(a/100);
            }else{
                if(b.style.filter!=undefined){
                    b.style.filter="alpha(opacity="+a+")";
                }
            }
        }
}
},
getOpacity:function(b){
    if(b.style.opacity!=undefined){
        return(Number(b.style.opacity)*100);
    }else{
        if(b.style.MozOpacity!=undefined){
            return(Number(b.style.MozOpacity)*100);
        }else{
            if(b.style.KhtmlOpacity!=undefined){
                return(Number(b.style.KhtmlOpacity)*100);
            }else{
                if(b.style.filter!=undefined){
                    var c,a;
                    c=b.style.filter;
                    a=parseInt(c.replace(")","").replace("alpha(opacity=",""))/100;
                    if(!isNaN(a)&&a!=""){
                        return a;
                    }
                    return"";
                }
            }
        }
}
},
clear:function(c){
    try{
        c.innerHTML="";
    }catch(d){}
    if(c.hasChildNodes()){
        var b=c.childNodes;
        for(var a=0;a<b.length;a++){
            b[a].parentNode.removeChild(b[a]);
            if(b[a]){
                tactile.c.E.clear(b[a]);
                b[a].parentNode.removeChild(b[a]);
            }
        }
        }
},
setInnerHTML:function(d,c,a){
    if(a&&a===true){}else{
        tactile.c.E.clear(d);
    }
    var b;
    if(typeof(HTMLElement)==="object"){
        if(d instanceof HTMLElement){
            if(tactile.c.E.isHTMLElement(c)){
                d.appendChild(c);
            }else{
                d.innerHTML=c;
            }
        }
    }else{
    if(d.nodeType&&d.nodeType==1){
        if((typeof c)=="string"){
            b=document.createTextNode(c);
            d.appendChild(c);
        }else{
            if((typeof c)=="object"){
                if(tactile.c.E.isHTMLElement(c)){
                    d.appendChild(c);
                }
            }
        }
}
}
},
getZindex:function(c){
    var b,a=0;
    b=tactile.c.E.getCurrStyle(c,"z-index");
    if(Number(b)){
        a=Number(b);
    }
    return a;
},
swapClass:function(e,b,a){
    if(e&&b&&a){
        var c,d;
        c=e.className;
        if(c&&c.length>0){
            d=c.split(" ");
            if(d.contains(b)){
                if(!d.contains(a)){
                    tactile.c.E.replaceClass(e,b,a);
                }else{
                    tactile.c.E.removeClass(e,a);
                }
            }else{
            if(d.contains(a)){
                tactile.c.E.replaceClass(e,a,b);
            }else{
                tactile.c.E.addClass(e,b);
            }
        }
    }else{
    e.className=b;
}
return e.className;
}
},
toggleClass:function(d,c){
    if(d&&c){
        var a,b;
        a=d.className;
        if(a&&a.length>0){
            b=a.split(" ");
            if(!b.contains(c)){
                d.className=a+" "+c;
            }else{
                tactile.c.E.removeClass(d,c);
            }
        }else{
        d.className=c;
    }
    return d.className;
}
},
replaceClass:function(f,b,h){
    if(f){
        var a,e,g,d;
        a=f.className;
        e=a.split(" ");
        g=e.indexOf(b);
        if(g!=-1){
            e[g]=h;
        }
        d="";
        for(var c=0;c<e.length;c++){
            if(d.length>0){
                d+=" "+e[c];
            }else{
                d+=e[c];
            }
        }
        if(d.length>0){
        f.className=d;
    }else{
        f.removeAttribute("class");
    }
    return f.className;
}
},
isChildOf:function(c,b){
    var a=b.getElementsByTagName("*");
    if(a.length>0){
        return Array.prototype.indexOf.call(a,c)!==-1;
    }
    return false;
},
getElementsByClassName:function(e,q){
    if(e&&q){
        if(e.getElementsByClassName){
            return e.getElementsByClassName(q);
        }else{
            var c;
            var d=[];
            var l,k,o,g;
            var h;
            var f=[];
            var b="";
            var n="";
            var a;
            var p=e;
            if(p.querySelectorAll){
                if(q){
                    a=q.split(" ");
                    for(l=0;l<a.length;l++){
                        b+="."+a[l];
                    }
                    d=p.querySelectorAll(b);
                }
            }else{
            c=p.getElementsByTagName("*");
            for(l=0;l<c.length;l++){
                h=c[l];
                if(h.className){
                    o=true;
                    f=h.className.split(" ");
                    for(k=0;k<a.length;k++){
                        if(!f.contains(a[k])){
                            o=false;
                            break;
                        }
                    }
                    if(o){
                    d[d.length]=h;
                }
            }
            }
    }
return d;
}
}
},
translate:function(b,a,c){
    if(b){
        a=tactile.c.U.parsePixel(a);
        c=tactile.c.U.parsePixel(c);
        tactile.c.E.transform(b,"translate",a,c);
    }
},
translateX:function(b,a){
    if(b){
        a=tactile.c.U.parsePixel(a);
        tactile.c.E.transform(b,"translateX",a);
    }
},
translateY:function(a,b){
    if(a){
        b=tactile.c.U.parsePixel(b);
        tactile.c.E.transform(a,"translateY",b);
    }
},
translateZ:function(a,b){
    if(a){
        b=tactile.c.U.parsePixel(b);
        tactile.c.E.transform(a,"translateZ",b);
    }
},
translate3d:function(b,a,d,c){
    if(b){
        a=tactile.c.U.parsePixel(a);
        d=tactile.c.U.parsePixel(d);
        c=tactile.c.U.parsePixel(c);
        if(tactile.c.D.browser.csstransforms3d){
            tactile.c.E.transform(b,"translate3d",a,d,c);
        }else{
            tactile.c.E.transform(b,"translate",a,d);
        }
    }
},
scale:function(b,a){
    if(b){
        a=parseFloat(a);
        tactile.c.E.transform(b,"scale",a,a);
    }
},
scaleX:function(b,a){
    if(b){
        a=parseFloat(a);
        tactile.c.E.transform(b,"scaleX",a);
    }
},
scaleY:function(b,a){
    if(b){
        a=parseFloat(a);
        tactile.c.E.transform(b,"scaleY",a);
    }
},
scaleZ:function(b,a){
    if(b){
        a=parseFloat(a);
        tactile.c.E.transform(b,"scaleZ",a);
    }
},
scale3d:function(b,a){
    if(b){
        a=parseFloat(a);
        if(tactile.c.D.browser.csstransforms3d){
            tactile.c.E.transform(b,"scale3d",a,a,a);
        }else{
            tactile.c.E.transform(b,"scale",a,a);
        }
    }
},
rotate:function(a,b){
    if(a){
        b=tactile.c.U.parseDeg(b);
        tactile.c.E.transform(a,"rotate",b);
    }
},
rotateX:function(a,b){
    if(a){
        b=tactile.c.U.parseDeg(b);
        tactile.c.E.transform(a,"rotateX",b);
    }
},
rotateY:function(a,b){
    if(a){
        b=tactile.c.U.parseDeg(b);
        tactile.c.E.transform(a,"rotateY",b);
    }
},
rotateZ:function(a,b){
    if(a){
        b=tactile.c.U.parseDeg(b);
        tactile.c.E.transform(a,"rotateZ",b);
    }
},
rotate3d:function(a,b){
    if(a){
        b=tactile.c.U.parseDeg(b);
        if(tactile.c.D.browser.csstransforms3d){
            tactile.c.E.transform(a,"scale3d",b,b,b);
        }else{
            tactile.c.E.transform(a,"scale",b,b);
        }
    }
},
transform:function(d,f,a,h,g){
    var c={
        scale:/scale\(.*?\)/,
        scaleX:/scaleX\(.*?\)/,
        scaleY:/scaleY\(.*?\)/,
        scaleZ:/scaleZ\(.*?\)/,
        scale3d:/scale3d\(.*?\)/,
        translate:/translate\(.*?\)/,
        translateX:/translateX\(.*?\)/,
        translateY:/translateY\(.*?\)/,
        translateZ:/translateZ\(.*?\)/,
        translate3d:/translate3d\(.*?\)/,
        rotateX:/rotateX\(.*?\)/,
        rotateY:/rotateY\(.*?\)/,
        rotateZ:/rotateZ\(.*?\)/,
        rotate:/rotate\(.*?\)/,
        rotate3d:/rotate3d\(.*?\)/
    };
    
    var b=d.style[tactile.c.D.browser.style.transformProperty];
    var e=null;
    if(arguments.length===3){
        e=f+"("+a+")";
    }else{
        if(arguments.length===4){
            e=f+"("+a+","+h+")";
        }else{
            if(arguments.length===5){
                e=f+"("+a+","+h+","+g+")";
            }
        }
    }
if(e!==null){
    if(b.length>0){
        if(b.indexOf(f)!==-1){
            d.style[tactile.c.D.browser.style.transformProperty]=b.replace(c[f],e);
        }else{
            d.style[tactile.c.D.browser.style.transformProperty]=b+" "+e;
        }
    }else{
    d.style[tactile.c.D.browser.style.transformProperty]=e;
}
}
}
};

tactile.c.U={
    setBodyStyle:function(a,b){
        if(tactile.c.D.browser.name!=="msie"){
            document.body.style[a]=b;
        }else{}
    },
applyTransformFlickerFix:function(b){
    var a=tactile.c.D.os.platform,c=tactile.c.D.browser.name,d=tactile.c.D.os.version;
    if(((a==="android")&&(c==="webkit"))||((a==="ios")&&(d>3))){
        b.style.webkitBackfaceVisibility="hidden";
    }
},
removeTransformFlickerFix:function(b){
    var a=tactile.c.D.os.platform,d=tactile.c.D.browser.name,f=tactile.c.D.os.version;
    if(((a==="android")&&(d==="webkit"))||((a==="ios")&&(f>3))){
        b.style.webkitBackfaceVisibility="";
        try{
            b.style.removeProperty("-webkit-backface-visibility");
        }catch(c){}
    }
},
updateRenderTreeFix:function(c){
    var b=function(f){
        var e=f.offsetWidth=f.offsetHeight;
        if(f.style&&f.style.width){
            return Number(f.style.width.replace("px",""));
        }
        return f.offsetWidth;
    };
    
    if(c){
        var a=c.offsetWidth,a=c.offsetHeight,a=c.offsetLeft,a=c.offsetTop;
        c.style.width=(b(c)+1)+"px";
        c.style.width=(b(c)-1)+"px";
    }
    var d=document.getFirstBodyChild();
    d.style.width=(b(d)+1)+"px";
    d.style.width=(b(d)-1)+"px";
},
getUID:function(){
    return((new Date()).getTime()+""+Math.floor(Math.random()*1000000)).substr(0,18);
},
mixin:function(d,c){
    var b={};
    
    for(var a in c){
        if((typeof b[a]=="undefined")||(b[a]!=c[a])){
            d[a]=c[a];
        }
    }
    },
extend:function(b,a){
    var c=function(){},d={};
    
    this.mixin(d,b.prototype);
    c.prototype=a.prototype;
    b.prototype=new c();
    b.prototype.constructor=b;
    b.superclass=a.prototype;
    b.extend(d);
},
fixLinks:function(){
    for(var a=0;a<document.links.length;a++){
        if(!document.links[a].url){
            document.links[a].url=document.links[a].href;
            document.links[a].href="javascript:function(){return false;}";
            document.links[a].addEventListener("touchstart",function(c){
                tactile.page.isClick=true;
                var b=this.href;
                this.href="javascript:function(){return false;}";
                window.setTimeout(function(){
                    if(tactile.page.isClick){
                        this.href=this.url;
                    }
                }.bind(this),300);
            },false);
        document.links[a].addEventListener("click",function(b){
            if(tactile.page.isClick){
                window.location=this.url;
                tactile.page.isClick=true;
            }
        },false);
    document.links[a].addEventListener("touchend",function(b){
        if(tactile.page.isClick){
            window.location=this.url;
            tactile.page.isClicke=true;
        }
        this.href="javascript:function(){return false;}";
    },false);
    }
}
},
attrValidator:{
    scriptString:"",
    leftString:"",
    rules:{
        getComponent:function(){
            var a=tactile.c.U.attrValidator.scriptString.substring(0,tactile.c.U.attrValidator.scriptString.indexOf(".")),b=null;
            var c=a!=""?a:tactile.c.U.attrValidator.scriptString;
            if(c.indexOf("#")>-1){
                c=c.substring(1,c.length);
            }
            b=(!tactile.page.getComponent(c)?window[c]:tactile.page.getComponent(c));
            if(!b){
                throw"Component is not exists";
            }else{
                tactile.c.U.attrValidator.leftString=tactile.c.U.attrValidator.scriptString.substring(a.length+1,tactile.c.U.attrValidator.scriptString.length);
            }
            return this.getComponentPath(b);
        },
        getComponentPath:function(b){
            var e=/^([a-zA-Z0-9.]+)\.[a-zA-Z0-9.\(]+/,f=tactile.c.U.attrValidator.leftString.match(e);
            if(f){
                var a=f[1];
                f=a.split(".");
                for(var d=0,c=f.length;d<c;d++){
                    if(b[f[d]]){
                        b=b[f[d]];
                    }else{
                        throw"Component is not exists";
                    }
                }
                tactile.c.U.attrValidator.leftString=tactile.c.U.attrValidator.leftString.replace(a+".","");
        }
        return this.getMethod(b);
    },
    getMethod:function(comp){
        var regex=/^(?:([a-zA-Z0-9.]+\(.*\))[.].*|([a-zA-Z0-9.]+\(.*\)))$/,func=tactile.c.U.attrValidator.leftString.match(regex),runComponent=null;
        if(func){
            func=(func[1]!==undefined?func[1]:func[2]);
            var funcName=func.substring(0,func.indexOf("(")),funcArgs=func.match(/\((.*)\)$/);
            if(comp[funcName]){
                var argument=null;
                if(funcArgs){
                    try{
                        argument=eval("["+funcArgs[1]+"]");
                    }catch(e){
                        throw"Invalid arguments for function";
                    }
                }
                if(tactile.c.U.attrValidator.leftString.replace(func,"")!=""){
                comp=comp[funcName].apply(null,argument);
                tactile.c.U.attrValidator.leftString=tactile.c.U.attrValidator.leftString.replace(func+".","");
                return this.getComponentPath(comp);
            }else{
                runComponent={
                    component:comp,
                    endFunction:funcName,
                    functionArguments:argument
                };
            
        }
    }
}else{
    runComponent={
        component:comp,
        endFunction:"show",
        functionArguments:[]
    };

}
return runComponent;
}
},
validate:function(d,b){
    this.scriptString=d;
    try{
        var a=this.rules.getComponent();
        if(b){
            a.component[a.endFunction].apply(a.component,a.functionArguments);
        }
        return a;
    }catch(c){
        console.error(c);
    }
}
},
getURLParam:function(d){
    var c="";
    var e=window.location.href;
    if(e.indexOf("?")>-1){
        var b=e.substr(e.indexOf("?")+1);
        var g=b.split("&");
        for(var a=0;a<g.length;a++){
            if(g[a].indexOf(d+"=")===0){
                var h=g[a].split("=");
                c=h[1];
                var f=c.indexOf("#");
                if(f>-1){
                    c=c.substring(0,f);
                }
                break;
            }
        }
        }
    return unescape(c);
},
parsePixel:function(a){
    a=a.toString();
    return parseFloat(a)+(a.match(/px/)||"px");
},
parseDeg:function(a){
    a=a.toString();
    return parseFloat(a)+(a.match(/deg/)||"deg");
}
};

tactile.c.A={
    rootPath:null,
    getXHRObject:function(){
        var e;
        if(window.XMLHttpRequest){
            e=new XMLHttpRequest();
        }else{
            if(window.ActiveXObject){
                try{
                    e=new ActiveXObject("Microsoft.XMLHTTP");
                }catch(d){
                    try{
                        e=new ActiveXObject("Msxml2.XMLHTTP");
                    }catch(c){
                        try{
                            e=new ActiveXObject("Msxml2.XMLHTTP.4.0");
                        }catch(b){
                            try{
                                e=new ActiveXObject("Msxml2.XMLHTTP.5.0");
                            }catch(a){
                                e=undefined;
                            }
                        }
                    }
            }
    }else{
    e=undefined;
}
}
if(e!=undefined){
    e.getResponseDom=function(){
        var f,g;
        f=e.responseText;
        g=null;
        if(f&&f!=null){
            g=tactile.c.O.stringToDom(f);
        }else{
            f=e.responseXML;
            if(f&&f!=null){
                g=tactile.c.O.xmlToDom(f);
                if(g.nodeType!=1){
                    g=tactile.c.O.getElementNode(g);
                }
            }
        }
    return g;
};

}
return e;
},
getRootPath:function(){
    var f,c,k,b,a,h,e,d;
    if(tactile.c.A.rootPath===null){
        var g=null;
        if(typeof nbdevice=="object"){
            if(a!==null&&h!==null){
                if(nbdevice.internalapppath){
                    e=nbdevice.internalapppath;
                }
                if(nbdevice.rifpath){
                    d=nbdevice.rifpath;
                }
            }
        }
    if(d===null||d.length===0){
    d="nbrif";
}
if(!(d.indexOf("http")===0)){
    d=e+d;
}
tactile.c.A.rootPath=d;
}
return tactile.c.A.rootPath;
},
initScript:function(element){
    var refNode=(typeof element=="string")?document.getElementById(element):element;
    if(refNode){
        var scripts=refNode.getElementsByTagName("script");
        for(var i=0;i<scripts.length;i++){
            eval(scripts[i].innerHTML);
        }
        }else{
    throw new tactile.c.Error("No Reference node found !");
}
},
getSessionID:function(){
    if(tactile.c.D.browser.canCookie){
        return";jsessionid="+tactile.c.C.getCookie("JSESSIONID");
    }else{
        var c,b,d,a;
        c=window.location.href;
        b=c.indexOf("?");
        d=c.indexOf(";jsessionid=");
        if(b>d){
            a=c.substring(d,b);
        }else{
            a=c.substring(d);
        }
        return a;
    }
}
};

tactile.c.O={
    getElementNode:function(a){
        var d;
        var c=a.childNodes;
        if(a.nodeType==9||a.nodeType==10||a.nodeType==11){
            for(var b=0;b<c.length;b++){
                if(c[b].nodeType==1){
                    d=c[b];
                    break;
                }
            }
            }else{
    d=c[0];
}
return d;
},
stringToDom:function(d){
    var a,e;
    e=document.createElement("div");
    e.innerHTML=d;
    if(e.childNodes.length>0){
        a=e.firstChild;
    }else{
        var b=new RegExp("(</?[^>]+>)","g");
        if(!(b.test(d))){
            var c=document.createTextNode(d);
            e.appendChild(c);
        }else{
            e=this.stringToDomParts(d);
        }
        if(e.childNodes.length>0){
            a=e.firstChild;
        }
    }
    return a;
},
stringToDomParts:function(k,f){
    if(!f){
        var f=document.createElement("div");
    }
    var n=new RegExp("(</?[^>]+>)","g"),d=k.split(n),g=false,a=false,l=false;
    for(var e=0;e<d.length;e++){
        if(a){
            if(/<\/[^>]+>/.test(d[e])&&d[e].substring(2,d[e].length-1)==a){
                var c=document.createElement(a);
                if(l&&l.length>0){
                    for(var b=0,o=l.length;b<o;b++){
                        var h=l[b].replace(/['"]/g,"");
                        c.setAttribute(h.split("=")[0].trim(),h.split("=")[1].trim());
                    }
                    }
                    arguments.callee(g,c);
            f.appendChild(c);
            a=false;
            g=false;
        }else{
            g+=d[e];
        }
    }else{
        if(!(n.test(d[e]))&&d[e]!=""){
            f.appendChild(document.createTextNode(d[e]));
        }else{
            if(/<[^>]+>/.test(d[e])){
                g="";
                a=d[e].substring(1,d[e].length-1);
                if(a.split(" ").length>1){
                    l=a.match(/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?/g);
                    a=a.split(" ")[0];
                }
            }
        }
}
}
return f;
},
xmlToDom:function(e){
    var g,f,k,h,c,a;
    if(e.nodeType==9||e.nodeType==10||e.nodeType==11){
        a=e.childNodes;
        for(var d=0;d<a.length;d++){
            if(a[d].nodeType==1){
                g=a[d];
                break;
            }
        }
        }else{
    g=e;
}
if(g.nodeType==1){
    f=document.createElement(g.nodeName);
    k=g.attributes;
    if(k&&k.length>0){
        for(var d=0;d<k.length;d++){
            h=document.createAttribute(k[d].nodeName);
            h.nodeValue=k[d].nodeValue;
            f.setAttributeNode(h);
        }
        }
        if(g.hasChildNodes()){
    a=g.childNodes;
    for(var b=0;b<a.length;b++){
        f.appendChild(tactile.c.O.xmlToDom(a[b]));
    }
    return f;
}else{
    return f;
}
}else{
    if(g.nodeType==3||g.nodeType==4){
        f=document.createTextNode(g.nodeValue);
        return f;
    }else{
        f=document.createTextNode("");
        return f;
    }
}
}
};

tactile.c.V={
    listeners:{},
    addResizeListener:function(c,b){
        if(typeof netbiscuits!=="undefined"&&netbiscuits.screen!=="undefined"&&netbiscuits.screen.resizeEvent!=="undefined"){
            var a=function(e,f){
                var d={
                    screenWidth:e,
                    screenHeight:f
                };
                
                c.call(b||c,d);
            };
            
            netbiscuits.screen.resizeEvent.add(a);
        }else{
            var a=function(d){
                c.call(b||c,d);
            };
            
            tactile.c.V.resizeEvent.add(a);
        }
    },
addManagedListener:function(d,e,c,b){
    var a;
    c.tactileUID=tactile.c.U.getUID();
    if(e.toLowerCase().indexOf("resize")!==-1||e.toLowerCase().indexOf("orientationchange")!==-1){
        tactile.c.V.addResizeListener(c);
        return true;
    }else{
        if("domcontentloaded".indexOf(e.toLowerCase())!==-1){
            tactile.c.V.domReady.add(c);
            return true;
        }else{
            if("click|mousedown|mouseup|mousemove".indexOf(e.toLowerCase())!==-1){
                a=function(f){
                    c.call(f,tactile.c.V.normalizeMouseEvent(f));
                };
            
        }else{
            a=function(f){
                b=b||window;
                c.call(b,tactile.c.V.normalizeEvent(f));
            };
        
    }
    a.tactileUID=c.tactileUID;
    return tactile.c.V.addListener(d,e,a);
}
}
},
addListener:function(b,c,a){
    if(b.addEventListener){
        tactile.c.V.addListner=function(f,g,e){
            var d=e.tactileUID?e.tactileUID:tactile.c.U.getUID();
            tactile.c.V.listeners[d]={
                element:f,
                event:g
            };
            
            window["anFunc_"+d]=function(h){
                e(h);
            };
            
            tactile.c.V.listeners[d].handler=window["anFunc_"+d];
            f.addEventListener(g,tactile.c.V.listeners[d].handler,false);
            return d;
        };
    
}else{
    throw new tactile.c.Error("browser do not support addEventListener");
}
return tactile.c.V.addListner(b,c,a);
},
removeManagedListener:function(e,f,d){
    var a;
    if("click|mousedown|mouseup|mousemove".indexOf(f.toLowerCase())!==-1){
        a=function(g){
            d.call(g,tactile.c.V.normalizeMouseEvent(g));
        };
    
}else{
    a=function(g){
        d.call(g,tactile.c.V.normalizeEvent(g));
    };

}
var b,c;
if(typeof e=="string"){
    b=e;
}else{
    b=d.tactileUID;
}
if(b in tactile.c.V.listeners){
    c=tactile.c.V.listeners[b].handler;
    e=tactile.c.V.listeners[b].element;
    tactile.c.V.removeListener(e,f,c);
    delete tactile.c.V.listeners[b];
}
},
removeListener:function(b,c,a){
    if(b.addEventListener){
        tactile.c.V.removeListener=function(e,f,d){
            e.removeEventListener(f,d,false);
        };
    
}else{
    throw new tactile.c.Error("browser do not support addEventListener");
}
tactile.c.V.removeListener(b,c,a);
},
normalizeEvent:function(b){
    b=b||window.event;
    var a={
        browserEvent:b,
        target:b.target||b.srcElement,
        type:b.type
        };
        
    return a;
},
normalizeMouseEvent:function(b){
    b=b||window.event;
    var a={
        browserEvent:b,
        target:b.target||b.srcElement,
        type:b.type,
        screenX:b.screenX,
        screenY:b.screenY,
        pageX:b.pageX||b.clientX,
        pageY:b.pageY||b.clientY,
        clientX:b.clientX,
        clientY:b.clientY,
        offsetX:b.offsetX||b.clientX,
        offsetY:b.offsetY||b.clientY,
        timeStamp:b.timeStamp||new Date().getTime()
        };
        
    return a;
},
domReady:{
    bInit:false,
    events:{},
    domReadyID:1,
    bDone:false,
    add:function(b){
        var a=tactile.c.V.domReady;
        if(!a.bInit){
            a.init();
        }
        if(!b.$$domReadyID){
            b.$$domReadyID=a.domReadyID++;
            if(a.bDone){
                b();
            }
            a.events[b.$$domReadyID]=b;
        }
    },
run:function(){
    var a=tactile.c.V.domReady;
    if(a.bDone){
        return;
    }
    a.bDone=true;
    for(var b in a.events){
        a.events[b]();
    }
    },
init:function(){
    if(document.addEventListener){
        document.addEventListener("DOMContentLoaded",function(){
            document.removeEventListener("DOMContentLoaded",arguments.callee,false);
            tactile.c.V.domReady.run();
        },false);
    }else{
        throw new tactile.c.Error("browser do not support addEventListener");
    }
    tactile.c.V.domReady.bInit=true;
}
},
resizeEvent:{
    events:{},
    eventID:1,
    bInit:false,
    width:0,
    height:0,
    add:function(b){
        var a=tactile.c.V.resizeEvent;
        if(!a.bInit){
            a.init();
        }
        if(!b.$$eventID){
            b.$$eventID=a.eventID++;
            a.events[b.$$eventID]=b;
        }
    },
run:function(){
    var b=tactile.c.V.resizeEvent;
    var a={
        screenWidth:b.width,
        screenHeight:b.height
        };
        
    for(var c in b.events){
        b.events[c](a);
    }
    },
init:function(){
    var a=tactile.c.V.resizeEvent;
    var b="resize";
    if(tactile.c.D.os.platform==="ios"){
        b="orientationchange";
    }else{
        if("onresize" in window){
            b="resize";
        }else{
            if("onorientationchange" in window){
                b="orientationchange";
            }
        }
    }
a.width=tactile.c.D.screen.getWidth();
a.height=tactile.c.D.screen.getHeight();
a.bInit=true;
tactile.c.V.addListener(window,b,a.fire);
},
fire:function(){
    setTimeout("tactile.c.V.resizeEvent.fireImpl("+10+")",100);
},
fireImpl:function(d){
    var b=tactile.c.V.resizeEvent;
    var c,a;
    c=tactile.c.D.screen.getWidth();
    a=tactile.c.D.screen.getHeight();
    if(b.width!==c){
        b.width=c;
        b.height=a;
        b.run();
    }else{
        if(d>0){
            setTimeout("tactile.c.V.resizeEvent.fireImpl("+(d-1)+")",100);
        }
    }
}
}
};

var JSON;
if(!JSON){
    JSON={};
    
}(function(){
    function f(n){
        return n<10?"0"+n:n;
    }
    if(typeof Date.prototype.toJSON!=="function"){
        Date.prototype.toJSON=function(key){
            return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null;
        };
    
}
if(typeof String.prototype.toJSON!=="function"){
    String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){
        return this.valueOf();
    };

}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={
    "\b":"\\b",
    "\t":"\\t",
    "\n":"\\n",
    "\f":"\\f",
    "\r":"\\r",
    '"':'\\"',
    "\\":"\\\\"
},rep;
function quote(string){
    escapable.lastIndex=0;
    return escapable.test(string)?'"'+string.replace(escapable,function(a){
        var c=meta[a];
        return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);
    })+'"':'"'+string+'"';
}
function str(key,holder){
    var i,k,v,length,mind=gap,partial,value=holder[key];
    if(value&&typeof value==="object"&&typeof value.toJSON==="function"){
        value=value.toJSON(key);
    }
    if(typeof rep==="function"){
        value=rep.call(holder,key,value);
    }
    switch(typeof value){
        case"string":
            return quote(value);
        case"number":
            return isFinite(value)?String(value):"null";
        case"boolean":case"null":
            return String(value);
        case"object":
            if(!value){
            return"null";
        }
        gap+=indent;
        partial=[];
        if(Object.prototype.toString.apply(value)==="[object Array]"){
            length=value.length;
            for(i=0;i<length;i+=1){
                partial[i]=str(i,value)||"null";
            }
            v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";
            gap=mind;
            return v;
        }
        if(rep&&typeof rep==="object"){
            length=rep.length;
            for(i=0;i<length;i+=1){
                if(typeof rep[i]==="string"){
                    k=rep[i];
                    v=str(k,value);
                    if(v){
                        partial.push(quote(k)+(gap?": ":":")+v);
                    }
                }
            }
        }else{
    for(k in value){
        if(Object.prototype.hasOwnProperty.call(value,k)){
            v=str(k,value);
            if(v){
                partial.push(quote(k)+(gap?": ":":")+v);
            }
        }
    }
    }
v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";
gap=mind;
return v;
}
}
if(typeof JSON.stringify!=="function"){
    JSON.stringify=function(value,replacer,space){
        var i;
        gap="";
        indent="";
        if(typeof space==="number"){
            for(i=0;i<space;i+=1){
                indent+=" ";
            }
            }else{
        if(typeof space==="string"){
            indent=space;
        }
    }
    rep=replacer;
if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){
    throw tactile.c.Error("JSON.stringify");
}
return str("",{
    "":value
});
};

}
if(typeof JSON.parse!=="function"){
    JSON.parse=function(text,reviver){
        var j;
        function walk(holder,key){
            var k,v,value=holder[key];
            if(value&&typeof value==="object"){
                for(k in value){
                    if(Object.prototype.hasOwnProperty.call(value,k)){
                        v=walk(value,k);
                        if(v!==undefined){
                            value[k]=v;
                        }else{
                            delete value[k];
                        }
                    }
                }
                }
            return reviver.call(holder,key,value);
}
text=String(text);
cx.lastIndex=0;
if(cx.test(text)){
    text=text.replace(cx,function(a){
        return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);
    });
}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){
    j=eval("("+text+")");
    return typeof reviver==="function"?walk({
        "":j
    },""):j;
}
throw tactile.c.Error("JSON.parse");
};

}
}());
if(tactile.effects==null||typeof(tactile.effects)!="object"){
    tactile.effects={};
    
}
if(tactile.events==null||typeof(tactile.events)!="object"){
    tactile.events={};
    
}
if(tactile.foundation==null||typeof(tactile.foundation)!="object"){
    tactile.foundation={};
    
}
if(tactile.errors==null||typeof(tactile.errors)!="object"){
    tactile.errors={};
    
}
tactile.errors.Base=function(){
    this.init();
};

tactile.errors.Base.prototype={
    init:function(a,c,b){
        this.name=a;
        this.message=c;
        this.number=b;
    },
    toString:function(){
        return this.name+" - "+this.number+": "+this.message;
    },
    printStackTrace:function(){
        if(tactile.logger.level===tactile.logger.level.error){
            var f=[];
            var g=new Error(this.message);
            if(g.stack){
                var b=g.stack.split("\n");
                for(var c=0,a=b.length;c<a;c++){
                    f.push(b[c]);
                }
                f.shift();
            }else{
                var d=arguments.callee.caller;
                while(d){
                    var h=d.name?d.name:(/\W*function\s+([\w\$]+)\(/.exec(d.toString()))[1];
                    if(h){
                        f.push(h);
                    }
                    d=d.caller;
                }
            }
            Logger.prototype.error(callstackr.join("\n\n"));
    }
}
};

tactile.errors.TypeError=function(b,a,c){
    this.init(b,a,c);
};

tactile.errors.TypeError.prototype={
    init:function(b,a,c){
        tactile.errors.TypeError.superclass.init.call(this,"TypeError",("The function "+b+" expects an argument of type "+a+", but was "+c),1004);
        this.printStackTrace();
    }
};

tactile.c.U.extend(tactile.errors.TypeError,tactile.errors.Base);
tactile.errors.ArgumentUndefined=function(b,a){
    this.init(b,a);
};

tactile.errors.ArgumentUndefined.prototype={
    init:function(b,a){
        tactile.errors.ArgumentUndefined.superclass.init.call(this,"ArgumentUndefined","Argument "+a+" is required for the function "+b+", but was undefined",1011);
        this.printStackTrace();
    }
};

tactile.c.U.extend(tactile.errors.ArgumentUndefined,tactile.errors.Base);
tactile.errors.InvalidArgument=function(b,a){
    this.init(b,a);
};

tactile.errors.InvalidArgument.prototype={
    init:function(b,a){
        tactile.errors.InvalidArgument.superclass.init.call(this,"InvalidArgument","Wrong value of "+a+" for the function "+b,1009);
        this.printStackTrace();
    }
};

tactile.c.U.extend(tactile.errors.InvalidArgument,tactile.errors.Base);
tactile.logger=(function(){
    var a={
        request:function(){
            var c=false;
            if(window.XMLHttpRequest){
                c=new XMLHttpRequest();
            }else{
                if(window.ActiveXObject){
                    c=new ActiveXObject("Microsoft.XMLHTTP");
                    if(!c){
                        HRequest=new ActiveXObject("Msxml2.XMLHTTP");
                    }
                }
            }
        return c;
},
sendRequest:function(f,e,g,c){
    var d=this.request();
    if(!d){
        return;
    }
    d.onreadystatechange=function(){
        if(d.readyState==4){
            c(d);
        }
    };
    
if(f.toLowerCase()=="get"&&g.length>0){
    e+="?"+g;
}
d.open(f,e,true);
    if(f.toLowerCase()=="post"){
    d.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");
    d.send(g);
}else{
    d.send(null);
}
}
};

var b=function(){};

b.extend({
    setConfig:function(d){
        d.overlayScriptUrl=d.overlayScriptUrl||"nbinternal/LoggerOverlay.js";
        this.message.isAjax=d.isAjax||false;
        this.message.isOverlay=d.isOverlay||false;
        this.level=d.level||0;
        this.message.height=d.height||300;
        this.setLevel(this.level);
        this.filter=d.filter||["all"];
        if(this.message.isAjax){
            if(d.ajaxUrl){
                this.message.ajaxUrl=d.ajaxUrl||"";
            }else{
                this.message.isAjax=false;
            }
        }
        if(this.message.isOverlay&&d.overlayScriptUrl){
        if(!tactile.loggerOverlay){
            var c=document.createElement("script");
            c.onload=function(){
                try{
                    this.message.overlayLoaded=tactile.loggerOverlay.createOverlay();
                }catch(f){
                    document.addEventListener("DOMContentLoaded",(function(){
                        this.message.overlayLoaded=tactile.loggerOverlay.createOverlay();
                    }).bind(this),false);
                }
            }.bind(this);
        c.type="text/javascript";
        c.src=d.overlayScriptUrl||"";
        document.getElementsByTagName("head")[0].appendChild(c);
    }else{
        this.message.overlayLoaded=tactile.loggerOverlay.createOverlay();
    }
}
if(this.message.isOverlay||this.message.isAjax){
    this.interval((d.timeout||400));
}
},
interval:function(c){
    setInterval((function(){
        if(this.message.isAjax){
            this.message.sendAjax();
        }
        if(this.message.isOverlay){
            this.message.printToOverlay();
        }
    }).bind(this),c);
},
message:{
    ajaxUrl:"",
    updateTime:0,
    lastUpdateTime:0,
    tplObj:{
        items:[{
            element:"ul",
            items:[{
                element:"li",
                key:"level"
            },{
                element:"li",
                key:"message"
            },{
                element:"li",
                key:"date"
            }]
            }]
        },
    template:function(k,e){
        var h=[],g,d,f;
        for(f=0;f<k.length;f++){
            g=document.createElement(k[f].element);
            if(k[f].items&&k[f].items.length>0){
                d=arguments.callee(k[f].items,e);
                for(var c=0;c<d.length;c++){
                    g.appendChild(d[c]);
                }
                }else{
            if(k[f].key){
                if(e[k[f].key]){
                    g.appendChild(document.createTextNode(e[k[f].key]));
                }
                g.setAttribute("class",(k[f].key=="level"?k[f].key+" "+e[k[f].key]:k[f].key));
            }
        }
        h.push(g);
    }
    return h;
},
createHtml:function(){
    var c=document.createElement("div");
    c.setAttribute("class","log-container");
    for(var e=0;e<this.logCollection.length;e++){
        var f=this.template(this.tplObj.items,this.logCollection[e]);
        for(var d=0;d<f.length;d++){
            c.appendChild(f[d]);
        }
        }
        return c;
},
logCollection:[],
clearResults:function(){
    if(this.ajaxPrinted&&this.overlayPrinted){
        this.lastUpdateTime=this.updateTime;
        this.logCollection=[];
    }
},
ajaxPrinted:true,
overlayPrinted:true,
sendAjax:function(){
    if(this.lastUpdateTime!=this.updateTime){
        var c=this.createHtml();
        a.sendRequest("post",this.ajaxUrl,(new XMLSerializer().serializeToString(c)),(function(){
            this.ajaxPrinted=true;
            this.clearResults();
        }).bind(this));
    }
},
printToOverlay:function(){
    if(!this.overlayLoaded){
        return false;
    }
    if(this.lastUpdateTime!=this.updateTime){
        var c=this.createHtml();
        tactile.loggerOverlay.print(c);
        this.overlayPrinted=true;
        this.clearResults();
    }
},
createReport:function(e,d){
    var c={
        level:e,
        message:d||"",
        date:(new Date()).toGMTString()
        };
        
    this.logCollection.splice(0,0,c);
    this.updateTime=(new Date()).getTime();
    this.ajaxPrinted=!this.isAjax;
    this.overlayPrinted=!this.isOverlay;
}
},
filter:["all"],
checkFilters:function(d,c){
    if(!c||typeof c!="string"){
        c="all";
    }
    if(this.filter.contains(c)||this.filter.contains("all")){
        return true;
    }
    return false;
},
error:function(d,c){
    if(!this.checkFilters.apply(this,arguments)){
        return false;
    }
    if(this.level>=1){
        this.message.createReport.call(this.message,"error",d);
        this.log("error",d);
    }
},
warn:function(d,c){
    if(!this.checkFilters.apply(this,arguments)){
        return false;
    }
    if(this.level>=2){
        this.message.createReport.call(this.message,"warn",d);
        this.log("warn",d);
    }
},
info:function(d,c){
    if(!this.checkFilters.apply(this,arguments)){
        return false;
    }
    if(this.level>=3){
        this.message.createReport.call(this.message,"info",d);
        this.log("info",d);
    }
},
log:function(d,c){
    if(typeof console==="object"&&console.log!==undefined){
        console.log(d+" - "+c);
    }
},
setLevel:function(c){
    this.level=c;
}
});
return new b();
})();
tactile.logger.level={
    info:3,
    warn:2,
    error:1,
    disabled:0
};

tactile.Device={
    type:tactile.c.D.type,
    isSmartphone:(tactile.c.D.type=="Mobile Phone"),
    isTablet:(tactile.c.D.type=="Tablet"),
    isEReader:(tactile.c.D.type=="eReader"),
    isDesktopBrowser:(tactile.c.D.type=="Desktop-Browser"),
    displayCategory:tactile.c.D.displayCategory,
    platform:tactile.c.D.os.platform,
    version:tactile.c.D.os.version,
    isTouch:tactile.c.D.os.isTouch,
    defaults:{
        effectduration:tactile.c.D.os.platform==="android"&&tactile.c.D.os.version<=2?1000:800
        },
    browser:{
        name:tactile.c.D.browser.name,
        canCookie:tactile.c.D.browser.canCookie,
        cssanimations:tactile.c.D.browser.cssanimations,
        csstransitions:tactile.c.D.browser.csstransitions,
        csstransforms:tactile.c.D.browser.csstransforms,
        csstransforms3d:tactile.c.D.browser.csstransforms3d,
        adressbarheight:tactile.c.D.browser.adressbarheight,
        borderradius:tactile.c.D.browser.borderradius,
        transitionEndEventType:function(){
            return tactile.c.D.browser.transitionEndEvent;
        },
        transitionEndEventSupported:function(){
            return tactile.c.D.browser.transitionEndEvent!=="";
        },
        style:{
            transitionProperty:tactile.c.D.browser.style.transitionProperty,
            transitionDuration:tactile.c.D.browser.style.transitionDuration,
            transitionTimingFunction:tactile.c.D.browser.style.transitionTimingFunction,
            transitionDelay:tactile.c.D.browser.style.transitionDelay,
            transformProperty:tactile.c.D.browser.style.transformProperty,
            perspectiveProperty:tactile.c.D.browser.style.perspectiveProperty,
            borderRadius:tactile.c.D.browser.style.borderRadius
            },
        prefixed:function(a){
            return tactile.c.D.browser.cssprefix+a;
        }
    },
screen:{
    getWidth:function(){
        return tactile.c.D.screen.getWidth();
    },
    getHeight:function(){
        return tactile.c.D.screen.getHeight();
    },
    isLandscape:function(){
        return tactile.c.D.screen.getWidth()>tactile.c.D.screen.getHeight();
    },
    isPortrait:function(){
        return tactile.c.D.screen.getHeight()>tactile.c.D.screen.getWidth();
    }
}
};

tactile.events.TouchEventManager=(function(){
    var a=function(){
        this.initTM=false;
    };
    
    a.prototype={
        activeTouches:{},
        pressDeltaTime:600,
        tapDeltaTime:200,
        scrollDeltaTime:300,
        swipeMotionDelta:100,
        scrollEventTouch:{},
        touchTarget:null,
        timeout:{},
        touchDistance:0,
        scrollStart:false,
        gestureDeltaTime:0,
        touchnames:"tap|doubletap|swipe|scroll|scrollstart|scrollend|touchstart|touchmove|touchend|rotate|pinch|spread|press",
        eventStartPosition:null,
        touchMoveDelta:5,
        listeners:{},
        init:function(){
            this.initTM=true;
            var b=this;
            if(tactile.Device.isTouch){
                document.addEventListener("touchstart",function(d){
                    b.onTouchStart(d);
                },false);
                document.addEventListener("touchmove",function(d){
                    b.onTouchMove(d);
                },false);
                document.addEventListener("touchend",function(d){
                    b.onTouchEnd(d);
                },false);
                if(tactile.Device.platform==="ios"){
                    document.addEventListener("gesturestart",function(d){
                        b.onEventCancel(d);
                    },false);
                    document.addEventListener("gesturechange",function(d){
                        b.onEventCancel(d);
                    },false);
                    document.addEventListener("gestureend",function(d){
                        b.onEventCancel(d);
                    },false);
                }
            }else{
            var c=function(d){
                d.touches=d.changedTouches=[d];
                b.onTouchMove(d);
            };
            
            document.addEventListener("mousedown",function(d){
                d.touches=[d];
                b.onTouchStart(d);
                document.addEventListener("mousemove",c,false);
            },false);
            document.addEventListener("mouseup",function(d){
                d.touches=d.changedTouches=[d];
                b.onTouchEnd(d);
                document.removeEventListener("mousemove",c,false);
            },false);
        }
    },
onEventCancel:function(b){
    b.preventDefault();
},
onTouchStart:function(b){
    this.touchTarget=b.target;
    this.isClick=true;
    this.gestureDeltaTime=b.timeStamp;
    this.eventStartPosition={
        x:b.touches[0].pageX,
        y:b.touches[0].pageY
        };
        
    this.registerTouches(b.touches);
    if(b.touches.length==1&&!this.timeout.tap){
        this.startTimer("press",b,function(c){
            this.fireEvent("press",c);
        });
    }else{
        if(this.timeout.press){
            this.clearTimeOut("press");
        }
    }
    this.fireEvent("touchstart",b);
    },
    onTouchMove:function(g){
        if(!tactile.pageLayout){
            g.preventDefault();
        }
        if(g.touches.length<2){
            var c=Math.abs(this.eventStartPosition.x-g.touches[0].pageX),b=Math.abs(this.eventStartPosition.y-g.touches[0].pageY);
            if(c<this.touchMoveDelta&&b<this.touchMoveDelta){
                return false;
            }
        }
        this.isClick=false;
    this.clearTimeOut(["press","doubletap","tap"]);
    var h={};
    
    for(var f=0,d=g.changedTouches.length;f<d;f++){
        h[g.changedTouches[f].identifier]=this.getTouchDirection(g.changedTouches[f]);
    }
    this.getMotionEventType(h,g);
    this.fireEvent("touchmove",g);
},
onTouchEnd:function(b){
    this.fireEvent("touchend",b);
    if(this.timeout.press){
        this.clearTimeOut("press");
        this.startTimer("tap",b);
    }else{
        if(this.timeout.tap){
            this.clearTimeOut("tap");
            this.fireEvent("doubletap",b);
        }
    }
    if(this.scrollStart){
    this.fireEvent("scrollend",b,this.scrollEventTouch);
    this.scrollStart=false;
    this.scrollEventTouch={};

}
this.eraseTouches(b.changedTouches);
if(b.touches.length===0){
    this.activeTouches={};

}
b.preventDefault();
},
onSwipe:function(k){
    var h=[],g;
    for(var f=0,c=k.changedTouches.length;f<c;f++){
        var d={};
        
        for(var b in this.activeTouches[k.changedTouches[f].identifier]){
            d[b]=this.activeTouches[k.changedTouches[f].identifier][b];
        }
        h.push(d);
    }
    g={
        timeStamp:k.timeStamp,
        pageX:k.pageX,
        pageY:k.pageY,
        touches:h,
        changedTouches:k.changedTouches,
        browserEvent:k,
        target:k.target,
        direction:k.changedTouches[0].pageX>this.activeTouches[k.changedTouches[0].identifier].pageX?"right":"left"
        };
        
    this.fireEvent("swipe",g);
},
simulateClick:function(c){
    if(c.type.toUpperCase().indexOf("MOUSE")!=-1){
        return;
    }
    var b=document.createEvent("MouseEvents");
    b.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);
    c.target.dispatchEvent(b);
},
registerTouches:function(d){
    for(var c=0,b=d.length;c<b;c++){
        this.cloneTouch(d[c]);
    }
    },
eraseTouches:function(d){
    for(var c=0,b=d.length;c<b;c++){
        delete this.activeTouches[d[c].identifier];
    }
    this.touchDistance=0;
},
getTouchDirection:function(c){
    if(this.activeTouches[c.identifier]){
        var b=[];
        if(this.activeTouches[c.identifier].clientX>c.clientX){
            b.push("left");
        }else{
            if(this.activeTouches[c.identifier].clientX<c.clientX){
                b.push("right");
            }
        }
        if(this.activeTouches[c.identifier].clientY>c.clientY){
        b.push("top");
    }else{
        if(this.activeTouches[c.identifier].clientY<c.clientY){
            b.push("bottom");
        }
    }
    return b;
}
},
getMotionEventType:function(r,o){
    var f=[],t=true;
    if(o.touches.length==o.changedTouches.length){
        for(var k in r){
            if(!f.length){
                f=r[k];
                continue;
            }
            if(r[k][0]!=f[0]||r[k][1]!=f[1]){
                t=false;
                break;
            }
        }
        }else{
    t=false;
    if(this.scrollStart){
        this.fireEvent("scrollend",o,this.scrollEventTouch,o.target);
        this.scrollStart=false;
        this.scrollEventTouch={};
    
}
}
if(t){
    this.generateScrollEndEvent(o);
    if(!this.scrollStart){
        this.generateScrollEndEvent(o);
        this.fireEvent("scrollstart",o,this.scrollEventTouch);
        this.scrollStart=true;
    }else{
        this.fireEvent("scroll",o,this.scrollEventTouch);
    }
    if((Math.abs(this.scrollEventTouch.deltaX)>this.swipeMotionDelta)&&Math.abs(this.scrollEventTouch.deltaX)>Math.abs(this.scrollEventTouch.deltaY)&&this.scrollEventTouch.deltaTime<this.scrollDeltaTime){
        this.onSwipe(o);
    }
}
if(o.touches.length==2&&!t){
    this.touchDistance=this.touchDistance?this.touchDistance:Math.abs(this.activeTouches[o.touches[0].identifier].pageX-this.activeTouches[o.touches[1].identifier].pageX)+Math.abs(this.activeTouches[o.touches[0].identifier].pageY-this.activeTouches[o.touches[1].identifier].pageY);
    var s=Math.abs(o.touches[0].pageX-o.touches[1].pageX)+Math.abs(o.touches[0].pageY-o.touches[1].pageY),p=o.timeStamp-this.gestureDeltaTime;
    if(this.touchDistance>s){
        this.fireEvent("pinch",o,{
            deltaTime:p,
            distance:s
        });
    }else{
        if(this.touchDistance<s){
            this.fireEvent("spread",o,{
                deltaTime:p,
                distance:s
            });
        }
    }
    var c,h,b,g,d,n,l,q;
if(o.changedTouches.length==1){
    for(d=0;d<o.touches.length;d++){
        if(o.touches[d].identifier!=o.changedTouches[0].identifier){
            c={
                x:o.touches[d].pageX,
                y:o.touches[d].pageY
                };
                
            b={
                x:this.activeTouches[o.touches[d].identifier].pageX,
                y:this.activeTouches[o.touches[d].identifier].pageY
                };
            
    }else{
        h={
            x:o.touches[d].pageX,
            y:o.touches[d].pageY
            };
            
        g={
            x:this.activeTouches[o.touches[d].identifier].pageX,
            y:this.activeTouches[o.touches[d].identifier].pageY
            };
        
    }
}
}else{
    if(o.changedTouches.length==2){
        c=b={
            x:(o.changedTouches[0].pageX+o.changedTouches[1].pageX)/2,
            y:(o.changedTouches[0].pageY+o.changedTouches[1].pageY)/2
            };
            
        d=o.changedTouches[0].pageX>c.x?0:1;
        h={
            x:o.touches[d].pageX,
            y:o.touches[d].pageY
            };
            
        g={
            x:this.activeTouches[o.touches[d].identifier].pageX,
            y:this.activeTouches[o.touches[d].identifier].pageY
            };
        
}
}
n=this.calculateAngle(b,g),l=this.calculateAngle(c,h),q=(n-l);
if(n!=l&&Math.abs(n-l)>3){
    this.fireEvent("rotate",o,{
        startAngle:n,
        currentAngle:l,
        rotationAngle:q,
        deltaTime:p
    });
}
this.touchDistance=s;
}
},
generateScrollEndEvent:function(b){
    this.scrollEventTouch={
        startX:this.activeTouches[b.touches[0].identifier].pageX,
        startY:this.activeTouches[b.touches[0].identifier].pageY,
        deltaX:(b.touches[0].pageX-this.activeTouches[b.touches[0].identifier].pageX),
        deltaY:(b.touches[0].pageY-this.activeTouches[b.touches[0].identifier].pageY),
        pageX:b.touches[0].pageX,
        pageY:b.touches[0].pageY,
        startTime:(this.scrollEventTouch.startTime?this.scrollEventTouch.startTime:b.timeStamp),
        deltaTime:(this.scrollEventTouch.startTime?b.timeStamp-this.scrollEventTouch.startTime:0)
        };
    
},
calculateAngle:function(e,g){
    var d=Math.abs(e.x-g.x),f=Math.abs(e.y-g.y),k=Math.sqrt((f*f)+(d*d)),i=Math.asin(f/k),h=i*(180/Math.PI);
    if(e.x>g.x&&e.y<g.y){
        h=-((90-h)+90);
    }
    if(e.x>g.x&&e.y>g.y){
        h=(90-h)+90;
    }
    if(e.x<g.x&&e.y<g.y){
        h=-h;
    }
    return Math.ceil(h);
},
startTimer:function(c,d,f){
    var b=this;
    this.timeout[c]=setTimeout(function(){
        b.clearTimeOut(c);
        if(f){
            f.call(b,d);
        }else{
            b.fireEvent(c,d);
        }
    },this[c+"DeltaTime"]);
},
clearTimeOut:function(c){
    var b;
    if(!c){
        for(b in this.timeout){
            this.clearTimeOut(this.timeout[b]);
        }
        }else{
    if(typeof c==="object"){
        for(b=0;b<c.length;b++){
            this.clearTimeOut(c[b]);
        }
        }else{
    clearTimeout(this.timeout[c]);
    delete this.timeout[c];
}
}
},
addListener:function(b,c,e){
    if(!this.initTM){
        this.init();
    }
    var d=null;
    if(typeof b==="string"){
        d=b;
    }else{
        if(tactile.c.E.isHTMLElement(b)){
            d=b.id;
        }else{
            if(b instanceof tactile.foundation.Element){
                d=b.elem.id;
            }
        }
    }
e.eventtype=c;
this.listeners[d]=this.listeners[d]||{};

this.listeners[d][c]=this.listeners[d][c]||[];
this.listeners[d][c].push(e);
},
removeListener:function(d,e,g){
    var f=null;
    if(typeof d==="string"){
        f=d;
    }else{
        if(tactile.c.E.isHTMLElement(d)){
            f=d.id;
        }else{
            if(d instanceof tactile.foundation.Element){
                f=d.elem.id;
            }
        }
    }
g=g.toString().replace(/[\s\t\n]+/g,"");
if(this.listeners[f]&&this.listeners[f][e]){
    for(var c=0,b=this.listeners[f][e].length;c<b;c++){
        if(this.listeners[f][e][c].toString().replace(/[\s\t\n]+/g,"")==g){
            this.listeners[f][e].splice(c,1);
        }
    }
    }
},
getListenersByElement:function(b){
    var c=b.id;
    if(this.listeners&&this.listeners[c]){
        return this.listeners[c];
    }
},
getListenersByEventName:function(b){
    var d=[];
    for(var c in this.listeners){
        if(this.listeners[c][b]){
            d.push({
                "element-id":c,
                fn:this.listeners[c][b]
                });
        }
    }
    return d;
},
fireEvent:function(f,h,k,g){
    var d;
    if(!h.browserEvent){
        d={
            timeStamp:h.timeStamp,
            pageX:h.pageX,
            pageY:h.pageY,
            touches:h.touches,
            changedTouches:h.changedTouches,
            browserEvent:h,
            currentTarget:null,
            target:g||this.touchTarget,
            type:f
        };
        
        var b;
        if(k){
            for(b in k){
                d[b]=k[b];
            }
            }
            }else{
    d=h;
}
var c=this.listeners[!d.currentTarget?d.target.id:d.currentTarget.id];
if(c&&c[f]){
    for(b=0,j=c[f].length;b<j;b++){
        c[f][b].call(!d.currentTarget?d.target:d.currentTarget,d);
    }
    }
    this.bubbling(f,d);
},
bubbling:function(c,d){
    var b=!d.currentTarget?d.target.parentNode:d.currentTarget.parentNode;
    if(b!=d.target.ownerDocument){
        d.currentTarget=b;
        this.fireEvent(c,d);
    }
},
cloneTouch:function(c){
    this.activeTouches[c.identifier]={};
    
    for(var b in c){
        this.activeTouches[c.identifier][b]=c[b];
    }
    },
isTouchEvent:function(b){
    if(this.touchnames.indexOf(b)!==-1){
        return true;
    }else{
        return false;
    }
}
};

return new a();
})();
tactile.Enum={
    Direction:{
        north:"north",
        east:"east",
        south:"south",
        west:"west"
    },
    Display:{
        block:"block",
        inline:"inline",
        none:"none",
        inherit:"inherit"
    },
    Effects:{
        slide:"slide",
        fade:"fade",
        expand:"expand"
    },
    FlexFlow:{
        horizontal:"horizontal",
        vertical:"vertical"
    },
    GridFlow:{
        horizontal:"horizontal",
        vertical:"vertical"
    },
    Dimension:{
        width:"width",
        height:"height"
    },
    Float:{
        left:"left",
        right:"right",
        none:"none",
        inherit:"inherit"
    },
    Overflow:{
        visible:"visible",
        hidden:"hidden",
        inherit:"inherit"
    },
    Position:{
        "static":"static",
        absolute:"absolute",
        relative:"relative",
        inherit:"inherit"
    },
    Scroll:{
        horizontal:"horizontal",
        vertical:"vertical",
        both:"both",
        disabled:"disabled"
    },
    Transitions:{
        linear:"linear",
        easeIn:"ease-in",
        easeOut:"ease-out",
        easeInOut:"ease-in-out",
        easeOutIn:"ease-out-in"
    },
    Unit:{
        percent:"%",
        px:"px",
        em:"em"
    },
    Events:{
        touchstart:"touchstart",
        touchmove:"touchmove",
        touchend:"touchend",
        scrollstart:"scrollstart",
        scroll:"scroll",
        scrollend:"scrollend",
        tap:"tap",
        doubletap:"doubletap",
        swipe:"swipe"
    },
    contains:function(e,d){
        if(d===undefined||d===null){
            return false;
        }
        var c=false;
        var b=d.toLowerCase();
        for(var a in e){
            if(e[a]==b){
                c=true;
                break;
            }
        }
        return c;
},
getValue:function(d,c){
    if(c===undefined){
        return"";
    }
    var b=c.toLowerCase();
    for(var a in d){
        if(d[a]==b){
            return d[a];
            break;
        }
    }
    return"";
},
getKey:function(d,c){
    if(c===undefined){
        return"";
    }
    var b=c.toLowerCase();
    for(var a in d){
        if(d[a]==b){
            return a;
            break;
        }
    }
    return"";
},
getKey:function(d,c){
    if(c===undefined){
        return"";
    }
    var b=c.toLowerCase();
    for(var a in d){
        if(d[a]==b){
            return a;
            break;
        }
    }
    return"";
}
};

tactile.effects.Operations={
    show:"show",
    hide:"hide",
    move:"move",
    none:"none"
};

tactile.effects.Properties={
    left:"left",
    top:"top",
    width:"width",
    height:"height"
};

tactile.effects.Method={
    javascript:"javascript",
    transition:"transition",
    transform:"transform",
    transform3d:"transform3d",
    disabled:"disabled"
};

tactile.effects.Direction={
    horizontal:"horizontal",
    vertical:"vertical"
};

tactile.effects.Transitions={
    linear:function(a){
        return a;
    },
    inQuad:function(a){
        return Math.pow(a,2);
    },
    inCubic:function(a){
        return Math.pow(a,3);
    },
    outQuad:function(a){
        return 1-Math.pow((a-1),2);
    },
    outCubic:function(a){
        return 1+Math.pow((a-1),3);
    },
    inOutQuad:function(a){
        return 2*Math.pow(a,3)+3*Math.pow(a,2);
    },
    inCirc:function(a){
        return 1-Math.sqrt(1-Math.pow(a,2));
    },
    outCirc:function(a){
        return Math.sqrt(a);
    },
    inElastic:function(a){
        return Math.pow(a,4)*Math.sin(a*Math.PI*6.5);
    },
    outElastic:function(a){
        return 1-Math.pow(a-1,4)*Math.sin((1-a)*Math.PI*6.5);
    },
    sinoidal:function(a){
        return(-Math.cos(a*Math.PI)/2)+0.5;
    },
    cosinus:function(a){
        return Math.cos(a);
    },
    decel:function(a){
        return -Math.pow(a,2)+2*a;
    }
};

tactile.effects.Transitions.easeIn=tactile.effects.Transitions.outCubic;
tactile.effects.Transitions.easeOut=tactile.effects.Transitions.sinoidal;
tactile.effects.Transitions.easeInOut=tactile.effects.Transitions.cosinus;
tactile.effects.Transitions.easeOutIn=tactile.effects.Transitions.decel;
tactile.effects.Timing={
    linear:"linear",
    easeIn:"ease-in",
    easeOut:"ease-out",
    easeInOut:"ease-in-out",
    easeOutIn:"ease-out-in"
};

tactile.effects.Base=new Function();
tactile.effects.Base.prototype={
    offsetInitialized:false,
    leftOffset:null,
    topOffset:null,
    timer:null,
    from:null,
    to:null,
    prop:null,
    start:null,
    endEventAdded:false,
    op:tactile.effects.Operations.none,
    init:function(a,b){
        if(!a instanceof tactile.foundation.UIContainer){
            throw tactile.errors.TypeError("tactile.effects.Slide","UIComponent",typeof a);
        }
        this.inst=a;
        b=b||{};
        
        this.duration=b.duration||tactile.Device.defaults.effectduration;
        this.useTransition=tactile.Device.browser.csstransitions;
        this.useTransform=tactile.Device.browser.csstransforms;
        this.useTransform3d=tactile.Device.browser.csstransforms3d;
        this.fps=20;
        if(typeof nbdevice=="object"){
            if(this instanceof tactile.effects.Slide){
                if(nbdevice.tactileslidemethod){
                    var c=nbdevice.tactileslidemethod.toLowerCase();
                    this.useTransform3d=(c==tactile.effects.Method.transform3d);
                    this.useTransform=(c==tactile.effects.Method.transform);
                    this.useTransition=(c==tactile.effects.Method.transition);
                    if(c==tactile.effects.Method.javascript&&nbdevice.tactileslidefps){
                        this.fps=Number(nbdevice.tactileslidefps);
                    }
                }
            }else{
        if(this instanceof tactile.effects.Fade){
            if(nbdevice.tactilefademethod){
                var c=nbdevice.tactilefademethod.toLowerCase();
                this.useTransform3d=(c==tactile.effects.Method.transform3d);
                this.useTransform=(c==tactile.effects.Method.transform);
                this.useTransition=(c==tactile.effects.Method.transition);
                if(c==tactile.effects.Method.javascript&&nbdevice.tactilefadefps){
                    this.fps=Number(nbdevice.tactilefadefps);
                }
            }
        }else{
    if(this instanceof tactile.effects.Expand){
        if(nbdevice.tactileexpandmethod){
            var c=nbdevice.tactileexpandmethod.toLowerCase();
            this.useTransform3d=(c==tactile.effects.Method.transform3d);
            this.useTransform=(c==tactile.effects.Method.transform);
            this.useTransition=(c==tactile.effects.Method.transition);
            if(c==tactile.effects.Method.javascript&&nbdevice.tactileexpandfps){
                this.fps=Number(nbdevice.tactileexpandfps);
            }
        }
    }
}
}
}
if(b.fps){
    this.fps=b.fps;
}
if(b.method&&b.method==tactile.effects.Method.javascript){
    this.useTransition=false;
    this.useTransform=false;
    this.useTransform3d=false;
}
if(b.method&&b.method==tactile.effects.Method.transition){
    this.useTransform=false;
    this.useTransition=true;
    this.useTransform3d=false;
}
if(b.method&&b.method==tactile.effects.Method.transform){
    this.useTransition=false;
    this.useTransform=true;
    this.useTransform3d=false;
}
if(b.method&&b.method==tactile.effects.Method.transform3d){
    this.useTransition=false;
    this.useTransform=false;
    this.useTransform3d=true;
}
if(this instanceof tactile.effects.Fade||this instanceof tactile.effects.Expand){
    this.useTransform3d=false;
}
if(this.useTransition||this.useTransform||this.useTransform3d){
    this.timing=tactile.effects.Timing.easeOut;
    if(b.transition&&tactile.Enum.contains(tactile.Enum.Transitions,b.transition)){
        this.timing=tactile.Enum.getValue(tactile.Enum.Transitions,b.transition);
    }
}else{
    this.timing=tactile.effects.Transitions.outCubic;
    if(b.transition&&tactile.Enum.contains(tactile.Enum.Transitions,b.transition)){
        this.timing=tactile.effects.Transitions[tactile.Enum.getKey(tactile.Enum.Transitions,b.transition)];
    }
}
if(this.useTransform||this.useTransform3d){
    if(this.inst instanceof tactile.FlexView){
        this.inst.flexitems.forEach(function(d){
            tactile.c.U.applyTransformFlickerFix(d.elem);
        });
    }else{
        tactile.c.U.applyTransformFlickerFix(this.inst.elem);
    }
}
this.setOffset();
},
getMethod:function(){
    if(this.useTransform3d){
        return tactile.effects.Method.transform3d;
    }else{
        if(this.useTransform){
            return tactile.effects.Method.transform;
        }else{
            if(this.useTransition){
                return tactile.effects.Method.transition;
            }else{
                return tactile.effects.Method.javascript;
            }
        }
    }
},
setOffset:function(){
    if(this.inst.parent){
        this.leftOffset=(typeof this.inst.configLeft==="function")?this.inst.configLeft(this.inst.getParentInnerBox()):0;
        this.topOffset=(typeof this.inst.configTop==="function")?this.inst.configTop(this.inst.getParentInnerBox()):0;
        this.offsetInitialized=true;
    }
},
step:function(){
    var c=(new Date).getTime();
    if(c<this.start+this.duration){
        var a=(c-this.start)/this.duration;
        var b=Math.round(this.from+(this.to-this.from)*this.timing(a));
        this.jsstep(b);
    }else{
        clearInterval(this.timer);
        this.timer=null;
        if(this.op==tactile.effects.Operations.hide){
            this.inst.elem.style.display=tactile.Enum.Display.none;
            if(this.inst.afterhide){
                this.inst.afterhide.fire({
                    targetId:this.inst.id
                    });
            }
        }else{
        if(this.op==tactile.effects.Operations.show){
            if(this.inst.aftershow){
                this.inst.aftershow.fire({
                    targetId:this.inst.id
                    });
            }
            if(this instanceof tactile.effects.Expand){
                this.inst.elem.style[this.prop]="";
            }
        }
    }
if(this.onend){
    this.onend.fire({
        operation:this.op
        });
}
this.op=tactile.effects.Operations.none;
}
},
setEndEvent:function(){
    if(this.endEventAdded){
        return;
    }
    if(tactile.Device.browser.transitionEndEventSupported()){
        if(!this.endEventAdded){
            tactile.c.V.addManagedListener(this.inst.elem,tactile.Device.browser.transitionEndEventType(),this.transitionEnd,this);
            this.endEventAdded=true;
        }
    }else{
    setTimeout(this.transitionEnd.bind(this),this.duration+200);
}
},
transitionEnd:function(a){}
};

tactile.effects.Slide=function(a,b){
    this.init(a,b);
};

tactile.effects.Slide.prototype={
    init:function(){
        tactile.effects.Slide.superclass.init.apply(this,arguments);
        this.jsstep=function(c){
            this.inst.elem.style[this.prop]=c+tactile.Enum.Unit.px;
        };
        
        this.onend=new tactile.foundation.Observer();
        this.scroll={
            x:0,
            y:0
        };
        
        this.posX=0;
        this.posY=0;
        this.transform={
            x:0,
            y:0
        };
        
        var a=this.inst.elem.style[tactile.Device.browser.style.transformProperty];
        if(a){
            a=a.replace(/px/g,"");
            var b=(a.substring(a.indexOf("(")+1,a.indexOf(")"))).split(",");
            this.transform={
                x:Number(b[0]),
                y:Number(b[1])
                };
            
    }
},
transitionEnd:function(b){
    var a=tactile.Device.browser.style,c=tactile.effects.Operations;
    if(this.op==c.none){
        return false;
    }
    if(this.useTransform||this.useTransform3d){
        if(this.op==c.move){
            tactile.c.U.updateRenderTreeFix(this.inst.elem);
        }
        if(this.op==c.hide){
            if(this.inst.scroller){}
        }
    }else{
    if(this.useTransition){
        this.inst.elem.style[a.transitionProperty]="";
        this.inst.elem.style[a.transitionDuration]="";
        this.inst.elem.style[a.transitionTimingFunction]="";
        this.inst.elem.style[this.prop]=this.to+tactile.Enum.Unit.px;
    }
}
if(this.op==c.hide){
    this.inst.elem.style.display=tactile.Enum.Display.none;
    if(this.inst.afterhide){
        this.inst.afterhide.fire({
            targetId:this.inst.id
            });
    }
}else{
    if(this.op==c.show){
        if(this.inst.aftershow){
            this.inst.aftershow.fire({
                targetId:this.inst.id
                });
        }
    }
}
if(this.op==c.show){
    if((tactile.Device.platform==="ios"&&tactile.Device.version>=5)||(tactile.Device.platform==="android"&&tactile.Device.version>=4)){
        window.setTimeout(function(){
            tactile.c.U.updateRenderTreeFix(this.inst.elem);
            if(tactile.Device.platform==="android"&&tactile.Device.version==4){
                window.setTimeout(function(){
                    tactile.c.U.updateRenderTreeFix(this.inst.elem);
                    window.setTimeout(function(){
                        tactile.c.U.updateRenderTreeFix(this.inst.elem);
                        window.setTimeout(function(){
                            tactile.c.U.updateRenderTreeFix(this.inst.elem);
                        }.bind(this),150);
                    }.bind(this),150);
                }.bind(this),150);
            }
        }.bind(this),50);
}
}
this.onend.fire({
    operation:this.op
    });
this.op=c.none;
},
show:function(e){
    this.setOffset();
    e=e||{};
    
    var d=tactile.Device.browser.style,h=tactile.effects.Operations,c=e.slidefrom||tactile.Enum.Direction.east,b;
    if(this.op!=h.none){
        return false;
    }
    if(c==tactile.Enum.Direction.east||c==tactile.Enum.Direction.west){
        this.prop=tactile.effects.Properties.left;
        b=tactile.effects.Properties.top;
        if(c==tactile.Enum.Direction.east){
            this.from=this.inst.getParentInnerBox().width+2*this.leftOffset;
        }else{
            this.from=-this.inst.getParentInnerBox().width;
        }
        var a=this.inst.validateNumber(this.inst.configLeft,this.inst.getOuterBox());
        if(a){
            this.to=a;
        }else{
            this.to=this.inst.getParentInnerBox().left;
        }
        this.posY=0;
    }else{
        this.prop=tactile.effects.Properties.top;
        b=tactile.effects.Properties.left;
        if(c==tactile.Enum.Direction.north){
            this.from=-this.inst.getParentInnerBox().height;
        }else{
            this.from=this.inst.getParentInnerBox().height;
        }
        var f=this.inst.validateNumber(this.inst.configTop,this.inst.getParentInnerBox());
        if(f){
            this.to=f;
        }else{
            this.to=this.inst.getParentInnerBox().top;
        }
        this.posX=0;
    }
    if(this.useTransform||this.useTransform3d){
        this.inst.elem.style[d.transitionProperty]="";
        this.inst.elem.style[d.transformProperty]="";
        this.inst.elem.style[d.transitionDuration]="";
        this.inst.elem.style[d.transitionTimingFunction]="";
        this.op=h.show;
        this.inst.setOpacity(0);
        this.inst.elem.style[b]=(b==tactile.effects.Properties.top)?this.topOffset+"px":this.leftOffset+"px";
        this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
        this.inst.elem.style.display=this.inst.elem.displayStyle;
        this.inst.update(this.inst.getParentInnerBox());
        this.inst.elem.style[d.transitionProperty]=tactile.Device.browser.prefixed("transform");
        this.inst.elem.style[d.transitionTimingFunction]=this.timing;
        this.inst.setOpacity(100);
        this.inst.elem.style[d.transitionDuration]=this.duration+"ms";
        if(c==tactile.Enum.Direction.east||c==tactile.Enum.Direction.west){
            var g=this.from;
            this.posX=-g+this.leftOffset;
            if(this.useTransform3d){
                this.inst.elem.style[d.transformProperty]="translate3d("+this.posX+"px,"+this.posY+"px,0px)";
            }else{
                this.inst.elem.style[d.transformProperty]="translate("+this.posX+"px,"+this.posY+"px)";
            }
        }else{
        var g=this.from;
        this.posY=-g+this.topOffset;
        if(this.useTransform3d){
            this.inst.elem.style[d.transformProperty]="translate3d("+this.posX+"px,"+this.posY+"px,0px)";
        }else{
            this.inst.elem.style[d.transformProperty]="translate("+this.posX+"px,"+this.posY+"px)";
        }
    }
    this.setEndEvent();
}else{
    if(this.useTransition){
        this.op=h.show;
        this.inst.elem.style[d.transitionProperty]=this.prop;
        this.inst.elem.style[d.transitionDuration]=this.duration+"ms";
        this.inst.elem.style[d.transitionTimingFunction]=this.timing;
        this.inst.elem.style[b]=(b==tactile.effects.Properties.top)?this.topOffset+"px":this.leftOffset+"px";
        this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
        this.inst.elem.style.display=this.inst.elem.displayStyle;
        this.inst.update(this.inst.getParentInnerBox());
        this.inst.elem.style[this.prop]=this.to+tactile.Enum.Unit.px;
        this.setEndEvent();
    }else{
        this.inst.setOpacity(0);
        this.inst.elem.style.display=this.inst.elem.displayStyle;
        this.inst.update(this.inst.getParentInnerBox());
        this.inst.elem.style[b]=(b==tactile.effects.Properties.top)?this.topOffset+"px":this.leftOffset+"px";
        this.inst.elem.style[this.prop]="";
        this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
        this.inst.setOpacity(100);
        this.op=h.show;
        this.start=(new Date).getTime();
        this.timer=setInterval(this.step.bind(this),1000/this.fps);
    }
}
tactile.logger.info(this.toString()+", show: "+this.inst.id+", from: "+this.from+", to: "+this.to);
return true;
},
hide:function(c){
    if(!this.offsetInitialized){
        this.setOffset();
    }
    c=c||{};
    
    var i=tactile.Device.browser.style,f=tactile.effects.Operations,d=c.slideto||tactile.Enum.Direction.west,a;
    if(this.op!=f.none){
        return false;
    }
    if(d==tactile.Enum.Direction.east||d==tactile.Enum.Direction.west){
        this.prop=tactile.effects.Properties.left;
        if(d==tactile.Enum.Direction.east){
            this.to=this.inst.getParentBox().width;
        }else{
            this.to=-this.inst.getParentBox().width;
        }
        this.posX+=this.to+this.transform.x;
        a=this.inst.validateNumber(this.inst.configLeft,this.inst.getParentInnerBox());
        if(a){
            this.from=a;
        }else{
            this.from=this.inst.getParentInnerBox().left;
        }
    }else{
    this.prop=tactile.effects.Properties.top;
    if(d==tactile.Enum.Direction.north){
        this.to=-this.inst.getParentBox().height;
    }else{
        this.to=this.inst.getParentBox().height;
    }
    this.posY+=this.to+this.transform.y;
    var h=this.inst.validateNumber(this.inst.configTop,this.inst.getParentInnerBox());
    if(h){
        this.from=h;
    }else{
        this.from=this.inst.getParentInnerBox().top;
    }
}
this.op=f.hide;
var e,b;
e=0;
b=0;
if(this.useTransform||this.useTransform3d){
    this.inst.elem.style[i.transitionProperty]=tactile.Device.browser.prefixed("transform");
    this.inst.elem.style[i.transitionTimingFunction]=this.timing;
    this.inst.elem.style[i.transitionDuration]=this.duration+"ms";
    var g=this.to;
    if(d==tactile.Enum.Direction.east||d==tactile.Enum.Direction.west){
        this.to=(d==tactile.Enum.Direction.east)?this.posX+this.leftOffset:this.posX-this.leftOffset;
        if(this.useTransform3d){
            this.inst.elem.style[i.transformProperty]="translate3d("+this.to+"px,"+this.posY+"px,0px)";
        }else{
            this.inst.elem.style[i.transformProperty]="translate("+this.to+"px,"+this.posY+"px)";
        }
    }else{
    this.to=(d==tactile.Enum.Direction.south)?this.posY+this.topOffset:this.posY-this.topOffset;
    if(this.useTransform3d){
        this.inst.elem.style[i.transformProperty]="translate3d("+this.posX+"px,"+this.to+"px,0px)";
    }else{
        this.inst.elem.style[i.transformProperty]="translate("+this.posX+"px,"+this.to+"px)";
    }
}
this.setEndEvent();
}else{
    if(this.useTransition){
        this.to=(d==tactile.Enum.Direction.east)?this.to+2*this.leftOffset:this.to;
        this.inst.elem.style[i.transitionProperty]=this.prop;
        this.inst.elem.style[i.transitionDuration]=this.duration+"ms";
        this.inst.elem.style[i.transitionTimingFunction]=this.timing;
        this.inst.elem.style[this.prop]=this.to+tactile.Enum.Unit.px;
        this.setEndEvent();
    }else{
        this.to=(d==tactile.Enum.Direction.east)?this.to+2*this.leftOffset:this.to;
        this.start=(new Date).getTime();
        this.timer=setInterval(this.step.bind(this),this.duration/this.fps);
    }
}
tactile.logger.info(this.toString()+", hide: "+this.inst.id+", from: "+this.from+", to: "+this.to);
return true;
},
move:function(d){
    d=d||{};
    
    var c=tactile.Device.browser.style,g=tactile.effects.Operations,b=d.slidedir||tactile.effects.Direction.vertical;
    if(this.op!=g.none){
        return false;
    }
    var a=this.inst.getParentInnerBox();
    if(b==tactile.effects.Direction.horizontal){
        this.prop=tactile.effects.Properties.left;
        this.to=d.to||a.left;
        this.from=d.from||this.inst.getOuterBox().left;
    }else{
        this.prop=tactile.effects.Properties.top;
        this.to=d.to||a.top;
        this.from=d.from||this.inst.getOuterBox().top;
    }
    if(this.useTransform||this.useTransform3d){
        this.op=g.move;
        this.inst.elem.style[c.transitionProperty]=tactile.Device.browser.prefixed("transform");
        this.inst.elem.style[c.transitionDuration]=this.duration+"ms";
        this.inst.elem.style[c.transitionTimingFunction]=this.timing;
        var f=this.to-this.from;
        var e="";
        if(b==tactile.effects.Direction.horizontal){
            e=this.useTransform3d?"translate3d("+f+"px, 0px, 0px)":"translate("+f+"px, 0px)";
            this.inst.elem.style[c.transformProperty]=e;
        }else{
            e=this.useTransform3d?"translate3d(0px, "+f+"px, 0px)":"translate(0px, "+f+"px)";
            this.inst.elem.style[c.transformProperty]="translate(0px, "+f+"px)";
        }
        this.setEndEvent();
        if(this.inst instanceof tactile.FlexView){
            this.inst.flexitems.forEach(function(h){
                tactile.c.U.applyTransformFlickerFix(h.elem);
            });
        }
    }else{
    if(this.useTransition){
        this.op=g.move;
        this.inst.elem.style[c.transitionProperty]=this.prop;
        this.inst.elem.style[c.transitionDuration]=this.duration+"ms";
        this.inst.elem.style[c.transitionTimingFunction]=this.timing;
        this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
        this.inst.elem.style[this.prop]=this.to+tactile.Enum.Unit.px;
        this.setEndEvent();
    }else{
        this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
        this.op=g.move;
        this.start=(new Date).getTime();
        this.timer=setInterval(this.step.bind(this),1000/this.fps);
    }
}
tactile.logger.info(this.toString()+", move: "+this.inst.id+", from: "+this.from+", to: "+this.to);
return true;
},
toString:function(){
    var a="javascript, Frames per sec.: "+this.fps;
    if(this.useTransition){
        a="transition";
    }
    if(this.useTransform){
        a="transform (2d)";
    }
    if(this.useTransform3d){
        a="transform 3d";
    }
    return"Object - tactile.effects.Slide: "+a;
}
};

tactile.c.U.extend(tactile.effects.Slide,tactile.effects.Base);
tactile.effects.Expand=function(a,b){
    this.init(a,b);
};

tactile.effects.Expand.prototype={
    init:function(){
        tactile.effects.Expand.superclass.init.apply(this,arguments);
        this.jsstep=function(a){
            tactile.c.U.updateRenderTreeFix(this.inst.elem);
            this.inst.elem.style[this.prop]=a+tactile.Enum.Unit.px;
        };
        
        this.onend=new tactile.foundation.Observer();
    },
    transitionEnd:function(){
        var a=tactile.Device.browser.style,b=tactile.effects.Operations;
        if(this.op==b.hide){
            this.inst.elem.style.display=tactile.Enum.Display.none;
            if(this.inst.afterhide){
                this.inst.afterhide.fire({
                    targetId:this.inst.id
                    });
            }
        }else{
        if(this.op==b.show){
            if(this.inst.aftershow){
                this.inst.aftershow.fire({
                    targetId:this.inst.id
                    });
            }
            this.inst.elem.style[this.prop]="";
        }
    }
    this.inst.elem.style[a.transitionProperty]="";
this.inst.elem.style[a.transitionDuration]="";
this.inst.elem.style[a.transitionTimingFunction]="";
this.onend.fire({
    operation:this.op
    });
if(this.op==b.show){
    if(tactile.Device.platform==="ios"&&tactile.Device.version>=5){
        window.setTimeout(function(){
            tactile.c.U.updateRenderTreeFix(this.inst.elem);
        }.bind(this),50);
    }
}
this.op=b.none;
},
transitionStart:function(){
    var b=tactile.Device.browser.style,a=this;
    this.inst.elem.style[b.transitionProperty]=this.prop;
    this.inst.elem.style[b.transitionDuration]=this.duration+"ms";
    this.inst.elem.style[b.transitionTimingFunction]=this.timing;
    window.setTimeout(function(){
        a.inst.elem.style[a.prop]=a.to+tactile.Enum.Unit.px;
        a.setEndEvent();
    },10);
},
show:function(b){
    if(this.op!=tactile.effects.Operations.none){
        return false;
    }
    b=b||{};
    
    var d=b.expand||tactile.Enum.Dimension.width;
    this.from=b.from||0;
    if(d==tactile.Enum.Dimension.width){
        this.prop=tactile.effects.Properties.width;
        var a=this.inst.validateNumber(this.inst.configWidth,this.inst.getParentInnerBox());
        if(a){
            this.to=a;
        }else{
            this.inst.elem.style.display=this.inst.elem.displayStyle;
            this.to=this.inst.elem.querySelector("div").offsetWidth;
            this.inst.elem.style.display=tactile.Enum.Display.none;
        }
    }else{
    this.prop=tactile.effects.Properties.height;
    var c=this.inst.validateNumber(this.inst.configHeight,this.inst.getParentInnerBox());
    if(c){
        this.to=c;
    }else{
        this.inst.elem.style.display=this.inst.elem.displayStyle;
        this.to=this.inst.elem.querySelector("div").offsetHeight;
        this.inst.elem.style.display=tactile.Enum.Display.none;
    }
}
if(this.useTransition){
    this.inst.setOpacity(0);
    this.inst.elem.style.display=this.inst.elem.displayStyle;
    this.inst.update(this.inst.getParentInnerBox());
    this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
    this.inst.setOpacity(100);
    this.layoutinit=true;
    this.op=tactile.effects.Operations.show;
    setTimeout(this.transitionStart.bind(this),50);
}else{
    this.inst.setOpacity(0);
    this.inst.elem.style.display=this.inst.elem.displayStyle;
    this.inst.update(this.inst.getParentInnerBox());
    this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
    this.inst.setOpacity(100);
    this.op=tactile.effects.Operations.show;
    this.start=(new Date).getTime();
    this.timer=setInterval(this.step.bind(this),1000/this.fps);
}
tactile.logger.info(this.toString()+", show: "+this.inst.id+", from: "+this.from+", to: "+this.to);
return true;
},
hide:function(c){
    c=c||{};
    
    var b=tactile.Device.browser.style,e=tactile.effects.Operations;
    dim=c.expand||tactile.Enum.Dimension.width;
    if(this.op!=e.none){
        return false;
    }
    this.to=c.to||0;
    if(dim==tactile.Enum.Dimension.width){
        this.prop=tactile.effects.Properties.width;
        var a=this.inst.validateNumber(this.inst.configWidth,this.inst.getParentInnerBox());
        this.from=a?a:this.inst.getOuterBox().width;
    }else{
        this.prop=tactile.effects.Properties.height;
        var d=this.inst.validateNumber(this.inst.configHeight,this.inst.getParentInnerBox());
        this.from=d?d:this.inst.getOuterBox().height;
    }
    if(this.useTransition){
        this.op=e.hide;
        this.inst.elem.style[this.prop]=this.from+tactile.Enum.Unit.px;
        window.setTimeout(function(){
            this.inst.elem.style[b.transitionProperty]=this.prop;
            this.inst.elem.style[b.transitionDuration]=this.duration+"ms";
            this.inst.elem.style[b.transitionTimingFunction]=this.timing;
            this.inst.elem.style[this.prop]=this.to+tactile.Enum.Unit.px;
            this.setEndEvent();
        }.bind(this),50);
    }else{
        this.op=e.hide;
        this.start=(new Date).getTime();
        this.timer=setInterval(this.step.bind(this),this.duration/this.fps);
    }
    tactile.logger.info(this.toString()+", hide: "+this.inst.id+", from: "+this.from+", to: "+this.to);
    return true;
},
toString:function(){
    var a="javascript, Frames per sec.: "+this.fps;
    if(this.useTransition){
        a="transition";
    }
    return"Object - tactile.effects.Expand: "+a;
}
};

tactile.c.U.extend(tactile.effects.Expand,tactile.effects.Base);
tactile.effects.Fade=function(a,b){
    this.init(a,b);
};

tactile.effects.Fade.prototype={
    init:function(a,b){
        tactile.effects.Fade.superclass.init.apply(this,arguments);
        this.jsstep=function(c){
            this.inst.setOpacity(c);
        };
        
        this.onend=new tactile.foundation.Observer();
        this.scroll={
            x:0,
            y:0
        };
    
},
transitionEnd:function(){
    var a=tactile.Device.browser.style,b=tactile.effects.Operations;
    if(this.op==b.hide){
        if(this.inst.scroller){}
        setTimeout((function(){
            this.transitionEndHide();
            if(this.inst.afterhide){
                this.inst.afterhide.fire({
                    targetId:this.inst.id
                    });
            }
        }).bind(this),50);
}else{
    if(this.op==b.show){
        if(this.inst.aftershow){
            this.inst.aftershow.fire({
                targetId:this.inst.id
                });
        }
    }
}
this.inst.elem.style[a.transitionProperty]="";
this.inst.elem.style[a.transitionDuration]="";
this.inst.elem.style[a.transitionTimingFunction]="";
this.onend.fire({
    operation:this.op
    });
if(this.op==b.show){
    if(tactile.Device.platform==="ios"&&tactile.Device.version>=5){
        window.setTimeout(function(){
            tactile.c.U.updateRenderTreeFix(this.inst.elem);
        }.bind(this),50);
    }
}
this.op=b.none;
},
transitionEndHide:function(){
    this.inst.elem.style.display=tactile.Enum.Display.none;
},
transitionStart:function(){
    var a=tactile.Device.browser.style;
    this.inst.elem.style[a.transitionProperty]=this.prop;
    this.inst.elem.style[a.transitionDuration]=this.duration+"ms";
    this.inst.elem.style[a.transitionTimingFunction]=this.timing;
    this.inst.setOpacity(this.to);
    this.setEndEvent();
},
show:function(b){
    var a=tactile.Device.browser.style,c=tactile.effects.Operations;
    if(this.op!=c.none){
        return false;
    }
    b=b||{};
    
    this.from=b.from||0;
    this.to=100;
    this.prop="opacity";
    if(this.useTransition){
        this.inst.setOpacity(0);
        this.inst.elem.style.display=this.inst.elem.displayStyle;
        this.inst.update(this.inst.getParentInnerBox());
        this.op=c.show;
        setTimeout(this.transitionStart.bind(this),50);
    }else{
        this.inst.setOpacity(0);
        this.inst.elem.style.display=this.inst.elem.displayStyle;
        this.inst.update(this.inst.getParentInnerBox());
        this.op=c.show;
        this.start=(new Date).getTime();
        this.timer=setInterval(this.step.bind(this),1000/this.fps);
    }
    tactile.logger.info(this.toString()+", show: "+this.inst.id+", from: "+this.from+", to: "+this.to);
    return true;
},
hide:function(b){
    b=b||{};
    
    var a=tactile.Device.browser.style,d=tactile.effects.Operations,c=b.expand||tactile.Enum.Dimension.width;
    if(this.op!=d.none){
        return false;
    }
    if(this.inst.scroller&&this.inst.scroller.scrolled){}
    this.to=b.to||0;
    this.from=100;
    this.prop="opacity";
    if(this.useTransition){
        this.op=d.hide;
        this.inst.elem.style[a.transitionProperty]=this.prop;
        this.inst.elem.style[a.transitionDuration]=this.duration+"ms";
        this.inst.elem.style[a.transitionTimingFunction]=this.timing;
        this.inst.setOpacity(this.to);
        this.setEndEvent();
    }else{
        this.op=d.hide;
        this.start=(new Date).getTime();
        this.timer=setInterval(this.step.bind(this),this.duration/this.fps);
    }
    tactile.logger.info(this.toString()+", hide: "+this.inst.id+", from: "+this.from+", to: "+this.to);
    return true;
},
toString:function(){
    var a="javascript, ";
    if(this.useTransition){
        a="transition";
    }
    return"Object - tactile.effects.Fade: "+a;
}
};

tactile.c.U.extend(tactile.effects.Fade,tactile.effects.Base);
tactile.effects.Animator=function(a,b){
    var c={};
    
    if(typeof a=="undefined"&&typeof b=="undefined"){
        return;
    }
    if(typeof a=="string"){
        a=document.getElementById(a);
    }
    c.visibleCheckInterval=90;
    c.requestAnimationFrameSupport=true;
    c.request;
    c.runs=0;
    c.pause=false;
    c.step=b;
    c.el=a;
    c.parents=[];
    window.requestAFrame=(function(){
        return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;
    })();
    if(!window.requestAFrame){
        window.requestAFrame=function(e,d){
            return window.setTimeout(e,1000/60);
        };
        
        c.requestAnimationFrameSupport=false;
    }
    window.cancelRequestAFrame=(function(){
        return window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;
    })();
    c.getElementParents=function(d){
        var e=[];
        while(d.parentNode){
            d=d.parentNode;
            e.push(d);
            if(d==parent){
                return e;
            }
        }
        return e;
};

c.getElementOffset=function(g){
    var f=0,e=0,d=[],h=[];
    while(g&&!isNaN(g.offsetLeft)&&!isNaN(g.offsetTop)){
        if(!((g.style.position==""||g.style.position=="static")&&(d.indexOf(g.offsetLeft)!=-1||h.indexOf(g.offsetTop)!=-1))){
            e+=g.offsetTop;
            f+=g.offsetLeft;
            d.push(f);
            h.push(e);
        }
        if(tactile.page.getComponent(g.id)){
            if(tactile.page.getComponent(g.id).scroller){
                break;
            }
        }
        g=g.parentNode;
}
return{
    y:e,
    x:f
};

};

c.parents=c.getElementParents(c.el);
c.offset=c.getElementOffset(c.el);
c.isElementVisible=function(f,d){
    for(var e=1;e<d.length;e++){
        if(d[e].tagName=="DIV"&&tactile.page.getComponent(d[e].id)){
            if(!tactile.page.getComponent(d[e].id).isVisible()){
                return false;
            }
        }
    }
    return true;
};

c.isElementInsideScrollArea=function(g,p,f){
    var k={},e,g=tactile.page.getComponent(g.id);
    var d={
        height:g.elem.offsetHeight,
        width:g.elem.offsetWidth
        };
        
    for(var h=1;h<p.length;h++){
        var l=tactile.page.getComponent(p[h].id);
        if(p[h].tagName=="DIV"&&tactile.page.getComponent(p[h].id)){
            if(typeof l.scroller!="undefined"){
                k=l.scroller.offset;
                e={
                    height:l.parent.elem.offsetHeight,
                    width:l.parent.elem.offsetWidth
                    };
                    
                break;
            }
        }
    }
    var n=!(e.height<(f.y-Math.abs(k.y)))&&!(Math.abs(k.y)>(f.y+d.height)),o=!(e.width<(f.x-Math.abs(k.x)))&&!(Math.abs(k.x)>(f.x+d.width));
return n&&o;
};

c.stepOut=function(){
    c.runs++;
    var d;
    if(!c.pause){
        if(this.requestAnimationFrameSupport){
            d=c.step();
            if(c.runs%c.visibleCheckInterval===0&&c.isElementInsideScrollArea(c.el,c.parents,c.offset)){
                c.pause=true;
            }
        }else{
        if(c.runs%c.visibleCheckInterval===0){
            if(c.isElementVisible(c.el,c.parents)&&c.isElementInsideScrollArea(c.el,c.parents,c.offset)){
                d=c.step(c.runs);
            }else{
                c.pause=true;
            }
        }else{
        d=c.step(c.runs);
    }
}
}else{
    if(c.runs%c.visibleCheckInterval===0){
        if(this.requestAnimationFrameSupport){
            if(c.isElementInsideScrollArea(c.el,c.parents,c.offset)){
                c.pause=false;
            }
        }else{
        if(c.isElementVisible(c.el,c.parents)&&c.isElementInsideScrollArea(c.el,c.parents,c.offset)){
            c.pause=false;
        }
    }
}
}
if(!d&&d!=undefined&&typeof(d)!="string"){
    cancelRequestAFrame(c.request);
}else{
    c.request=requestAFrame(c.stepOut,c.el);
}
};

c.stop=function(){
    cancelRequestAFrame(c.request);
};

c.start=function(){
    if(this.requestAnimationFrameSupport){
        if(c.isElementInsideScrollArea(c.el,c.parents,c.offset)){
            c.stepOut();
        }
    }else{
    if(c.isElementVisible(c.el,c.parents)&&c.isElementInsideScrollArea(c.el,c.parents,c.offset)){
        c.stepOut();
    }
}
};

c.start();
return{
    element:c.el,
    stop:c.stop,
    start:c.start
    };

};

tactile.foundation.Observer=function(){
    this.fns=[];
};

tactile.foundation.Observer.prototype={
    subscribe:function(c,b){
        var a=b||window;
        this.fns.push({
            fn:c,
            scope:a
        });
    },
    unsubscribe:function(a){
        this.fns=this.fns.filter(function(b){
            if(b.fn!==a){
                return b;
            }
        });
},
fire:function(b,a){
    this.fns.forEach(function(d){
        var c=a||d.scope;
        d.fn.call(c,b);
    });
}
};

tactile.foundation.Scroller=function(a,e){
    if(a instanceof tactile.View==false&&a instanceof tactile.FlexView==false&&a instanceof tactile.GridView==false){
        throw new tactile.errors.TypeError("tactile.foundation.Scroller","tactile.View or tactile.FlexView or tactile.GridView",typeof a);
    }
    if(!a.parent){
        tactile.logger.warn("No parent specified for "+this.id+" "+this.toString());
    }
    if(!(a.parent instanceof tactile.foundation.UIContainer)){
        throw new tactile.errors.TypeError("tactile.foundation.Scroller","tactile.foundation.UIContainer",typeof a.parent);
    }
    if(!e){
        throw new tactile.errors.ArgumentUndefined("tactile.foundation.Scroller","config");
    }
    this.view=a;
    if(a instanceof tactile.FlexView||a instanceof tactile.GridView||a instanceof tactile.View){
        var g=a.elem.childNodes[1]||a.elem.childNodes[0];
        g.id=a.elem.id+Math.random().toString().replace(".","");
        this.elem=g;
    }else{
        this.elem=a.elem;
    }
    this.elem.scrollContainer=a.elem;
    this.parent=a.parent;
    this.touchId=null;
    this.stopBubbling=false;
    this.onstart=new tactile.foundation.Observer();
    this.onscroll=new tactile.foundation.Observer();
    this.onend=new tactile.foundation.Observer();
    this.onboundary=new tactile.foundation.Observer();
    this.bounce=typeof e.bounce==="boolean"?e.bounce:true;
    this.onbouncestart=new tactile.foundation.Observer();
    this.onbounceend=new tactile.foundation.Observer();
    this.getDirection=undefined;
    if(typeof e.scroll==="function"){
        this.getDirection=e.scroll;
    }else{
        if(tactile.Enum.contains(tactile.Enum.Scroll,e.scroll)){
            this.getDirection=function(){
                return tactile.Enum.getValue(tactile.Enum.Scroll,e.scroll);
            };
        
    }else{
        this.getDirection=function(){
            return tactile.Enum.Scroll.vertical;
        };
    
}
}
this.state=this.validDirection();
var c={
    direction:e.scroll
    };
    
if(e.scrollbar){
    c=e.scrollbar;
}
if(e.scrollbar&&e.scrollbar.direction===undefined){
    c.direction=e.scroll;
}
if(c.direction!=tactile.Enum.Scroll.disabled){
    this.scrollbar=new tactile.foundation.ScrollBar(this,c);
}
this.useTransform=tactile.Device.browser.csstransforms;
this.useTransform3d=tactile.Device.browser.csstransforms3d&&tactile.Device.platform==="ios";
if(typeof nbdevice==="object"&&typeof nbdevice.tactilescrollermethod==="string"){
    var h=nbdevice.tactilescrollermethod.toLowerCase();
    if(nbdevice.tactilescrollermethod){
        this.useTransform=(h===tactile.effects.Method.transform);
        this.useTransform3d=(h===tactile.effects.Method.transform3d);
    }
}
if(e.method&&e.method==tactile.effects.Method.javascript){
    this.useTransform=false;
    this.useTransform3d=false;
}
if(e.method&&e.method==tactile.effects.Method.transform){
    this.useTransform=true;
    this.useTransform3d=false;
}
if(e.method&&e.method==tactile.effects.Method.transform3d){
    this.useTransform=false;
    this.useTransform3d=true;
}
if(!this.useTransform&&!this.useTransform3d){
    this.elem.style.position="absolute";
}
var f=25;
if(tactile.Device.platform==="ios"&&tactile.Device.version>=3){
    f=100;
}
this.minVelocity=0.1;
this.topOffset=this.view.validateNumber(this.view.configTop,this.view.getParentInnerBox())||0;
this.fps=e.fps||f;
this.frameinterval=1000/this.fps;
this.previousTime=0;
this.duration=1000;
this.transition=e.transition||tactile.effects.Transitions.outQuad;
this.offset={
    x:0,
    y:0
};

this.start={
    x:0,
    y:0
};

this.from={
    x:0,
    y:0
};

this.to={
    x:0,
    y:0
};

this.timer={
    x:null,
    y:null
};

this.startTime={
    x:null,
    y:null
};

var b=this;
this.elem.me=b;
tactile.events.TouchEventManager.addListener(this.elem,"scrollstart",b.onScrollStart);
tactile.events.TouchEventManager.addListener(this.elem,"scroll",b.onScrollMove);
tactile.events.TouchEventManager.addListener(this.elem,"scrollend",b.onScrollEnd);
tactile.events.TouchEventManager.addListener(this.elem,"touchmove",b.onTouchMove);
this.view.onresize.subscribe(this.update,this);
this.checkLimits();
this.scrolling=false;
this.scrolled=false;
this.bouncing=false;
this.boundary=false;
var d=tactile.Device.browser.style;
if(this.useTransform3d){
    this.elem.style[d.transformProperty]="translate3d(0px, 0px,0px)";
}else{
    this.elem.style[d.transformProperty]="translate(0px, 0px)";
}
};

tactile.foundation.Scroller.extend({
    validDirection:function(){
        var b,a;
        a="vertical";
        try{
            b=this.getDirection();
        }catch(c){
            tactile.logger.error(this.id+".getDirection() has thrown an exception: "+c);
        }
        if(tactile.Enum.contains(tactile.Enum.Scroll,b)){
            a=b;
        }else{
            tactile.logger.error(this.id+".getDirection(): TypeError ("+b+" is not a valid direction)");
        }
        return a;
    },
    scrollVertical:function(){
        if(this.validDirection()==tactile.Enum.Scroll.vertical||this.validDirection()==tactile.Enum.Scroll.both){
            return true;
        }else{
            return false;
        }
    },
scrollHorizontal:function(){
    if(this.validDirection()==tactile.Enum.Scroll.horizontal||this.validDirection()==tactile.Enum.Scroll.both){
        return true;
    }else{
        return false;
    }
},
scrollBoth:function(){
    if(this.validDirection()==tactile.Enum.Scroll.both){
        return true;
    }else{
        return false;
    }
},
checkLimits:function(){
    var i=this.elem.scrollContainer.scrollWidth;
    var k=this.elem.scrollContainer.scrollHeight;
    var l=this.bounce?0:0.5;
    var h=this.parent.getInnerBox();
    var b=this.bounce?1:0;
    var f=this.elem.scrollContainer.scrollWidth<h.width;
    var d=this.elem.scrollContainer.scrollHeight<h.height;
    if(tactile.Device.isDesktopBrowser){
        i+=Math.abs(this.offset.x);
        k+=Math.abs(this.offset.y);
    }
    var e,a,g,c;
    e=f?-this.elem.scrollContainer.offsetWidth*0.5*b:-i+Math.round((0.5+l)*h.width);
    a=f?h.width*0.5*b:Math.round((0.5-l)*h.width);
    g=d?h.height*0.5*b:Math.round((0.5-l)*h.height);
    c=d?-this.elem.scrollContainer.offsetHeight*0.5*b:-k+h.height-Math.round((0.5-l)*h.height)-this.topOffset;
    this.limits={
        minLeft:e,
        maxLeft:a,
        minTop:c,
        maxTop:g
    };

},
scrollProperty:{},
scrollTimeMax:300,
onScrollStart:function(b){
    var a=this.me;
    a.boundary=false;
    a.scrolled=false;
    if(b.browserEvent&&b.browserEvent.touches){
        if(b.browserEvent.touches.length>1&&a.touchId!=null&&b.browserEvent.touches[1].identifier!=a.touchId){
            return;
        }
        a.touchId=b.browserEvent.touches[0].identifier;
    }
    a.checkLimits();
    a.start.x=b.pageX-a.offset.x;
    a.start.y=b.pageY-a.offset.y;
    a.previousTime=b.timeStamp;
    a.scrollProperty={
        old:(new Date()).getTime(),
        now:(new Date()).getTime(),
        startX:b.pageX,
        startY:b.pageY
        };
        
    if(a.timer.x){
        clearInterval(a.timer.x);
        a.timer.x=null;
    }
    if(a.timer.y){
        clearInterval(a.timer.y);
        a.timer.y=null;
    }
    if(!a.stopBubbling){
        a.onstart.fire({
            offsetX:a.offset.x,
            offsetY:a.offset.y,
            direction:a.validDirection()
            });
    }
},
onScrollMove:function(h){
    var d=this.me,f=tactile.Device.browser.style,c;
    if(d.view.state==="hiding"||d.view.state==="showing"){
        return;
    }
    if(h.browserEvent&&h.browserEvent.touches){
        if(h.browserEvent.touches.length>1&&d.touchId!=null&&h.browserEvent.touches[1].identifier!=d.touchId){
            return;
        }
        d.touchId=h.browserEvent.touches[0].identifier;
    }
    if(d.scrollVertical()&&(d.offset.y>d.limits.maxTop||d.offset.y<d.limits.minTop)){
        if(!d.boundary){
            d.onboundary.fire({
                offsetX:d.offset.x,
                offsetY:d.offset.y,
                direction:d.validDirection()
                });
            d.boundary=true;
        }
        return;
    }
    if(d.scrollHorizontal()&&(d.offset.x>d.limits.maxLeft||d.offset.x<d.limits.minLeft)){
        if(!d.boundary){
            d.onboundary.fire({
                offsetX:d.offset.x,
                offsetY:d.offset.y,
                direction:d.validDirection()
                });
            d.boundary=true;
        }
        return;
    }
    d.scrolling=true;
    var g=d.view.validateNumber(d.view.configTop,d.view.getParentInnerBox());
    d.view.elem.style.top=(g!==null)?g+"px":"";
    if(h.timeStamp-d.previousTime>=d.frameinterval){
        d.previousTime=h.timeStamp;
        var b=d.scrollHorizontal()?h.pageX-d.start.x:d.offset.x;
        var a=d.scrollVertical()?h.pageY-d.start.y:d.offset.y;
        if(!d.bounce&&(a>d.limits.maxTop||a<d.limits.minTop)){
            d.stopBubbling=true;
            return;
        }else{
            d.stopBubbling=false;
        }
        d.offset.x=b;
        d.offset.y=a;
        if(d.useTransform||d.useTransform3d){
            c=0+tactile.Enum.Unit.px,ty=0+tactile.Enum.Unit.px;
            if(d.scrollHorizontal()){
                c=d.offset.x+tactile.Enum.Unit.px;
            }
            if(d.scrollVertical()){
                ty=d.offset.y+tactile.Enum.Unit.px;
            }
            if(d.useTransform3d){
                d.elem.style[f.transformProperty]="translate3d("+c+", "+ty+",0px)";
            }else{
                d.elem.style[f.transformProperty]="translate("+c+", "+ty+")";
            }
        }else{
        if(d.scrollHorizontal()){
            d.elem.style.left=d.offset.x+tactile.Enum.Unit.px;
        }
        if(d.scrollVertical()){
            d.elem.style.top=Math.round(d.offset.y)+tactile.Enum.Unit.px;
        }
    }
    d.scroll.x=d.offset.x;
d.scroll.y=d.offset.y;
d.scrolled=true;
d.getCurrentPosition.call(this,h);
d.onscroll.fire({
    offsetX:d.offset.x,
    offsetY:d.offset.y,
    direction:d.validDirection()
    });
}
},
getCurrentPosition:function(c){
    var a=this.me;
    var b=(new Date()).getTime();
    if(b-a.scrollProperty.now>a.scrollTimeMax){
        a.scrollProperty.old=a.scrollProperty.now;
        a.scrollProperty.now=b;
        a.scrollProperty.startX=c.pageX;
        a.scrollProperty.startY=c.pageY;
    }
},
scrollBack:function(){
    var a=this.parent.getInnerBox();
    var c={
        x:this.offset.x,
        y:this.offset.y
        };
        
    var b={
        x:a.left,
        y:a.top
        };
        
    this.scroll(c,b);
},
reset:function(){
    var b=this.parent.getInnerBox(),d=0,c=0,a=tactile.Device.browser.style;
    if(this.scrollBoth()){
        d=b.left;
        c=b.top;
        this.offset.x=0;
        this.offset.y=0;
        if(!this.useTransform3d&&!this.useTransform){
            this.elem.style.left=d+tactile.Enum.Unit.px;
            this.elem.style.top=c+tactile.Enum.Unit.px;
        }
    }else{
    if(this.scrollVertical()){
        c=b.top;
        this.offset.y=0;
        if(!this.useTransform3d&&!this.useTransform){
            this.elem.style.top=c+tactile.Enum.Unit.px;
        }
    }else{
    d=b.left;
    this.offset.x=0;
    if(!this.useTransform3d&&!this.useTransform){
        this.elem.style.left=d+tactile.Enum.Unit.px;
    }
}
}
if(this.useTransform3d){
    this.elem.style[a.transformProperty]="translate3d(0px,0px,0px)";
}else{
    if(this.useTransform){
        this.elem.style[a.transformProperty]="translate(0px,0px)";
    }
}
},
onScrollEnd:function(f){
    var l=this.me,c,a=(new Date()).getTime();
    l.getCurrentPosition.call(this,f);
    if(l.scrolled){
        c={
            x:(f.pageX-l.scrollProperty.startX)/(a-l.scrollProperty.old),
            y:(f.pageY-l.scrollProperty.startY)/(a-l.scrollProperty.old)
            };
            
        var d=l.parent.getInnerBox();
        if(l.bounce){
            if(l.scrollVertical()){
                if(l.offset.y>0||l.offset.y<(-l.elem.scrollHeight+d.height-l.topOffset)){
                    l.bouncing=true;
                }
            }
            if(l.scrollHorizontal()){
            if(l.offset.x>0||l.offset.x<(-l.elem.scrollWidth+d.width)){
                l.bouncing=true;
            }
        }
        if(l.bouncing){
        l.onbouncestart.fire({
            offsetX:l.offset.x,
            offsetY:l.offset.y,
            direction:l.validDirection()
            });
    }
}
var b=l.duration;
if(l.scrollBoth()){
    b=(Math.abs(c.y)>Math.abs(c.x))?Math.abs(c.y)*l.duration*0.7:Math.abs(c.x)*l.duration*0.7;
}else{
    b=l.scrollVertical()?Math.abs(c.y)*l.duration*0.7:Math.abs(c.x)*l.duration*0.7;
}
if(l.scrollVertical()&&!l.scrollBoth()){
    if(Math.abs(c.y)<0.3){
        l.onComplete();
        return;
    }
}else{
    if(l.scrollHorizontal()&&!l.scrollBoth()){
        if(Math.abs(c.x)<0.3){
            l.onComplete();
            return;
        }
    }
}
var k=Math.round(c.x*b);
var g=Math.round(c.y*b);
var i={
    x:l.offset.x,
    y:l.offset.y
    };
    
var h={
    x:i.x+k,
    y:i.y+g
    };
    
if(!l.bounce){
    h.x=(h.x>l.maxLeft)?l.maxLeft:h.x;
    h.x=(h.x<l.minLeft)?l.minLeft:h.x;
    h.y=(h.y>l.maxTop)?l.maxTop:h.y;
    h.y=(h.y<l.minTop)?l.minTop:h.y;
}
l.scroll(i,h);
}
},
onComplete:function(){
    var a=this.parent.getInnerBox();
    var b=false;
    if(this.scrollVertical()){
        if(this.offset.y==0){}else{
            if(this.offset.y>0){
                this.to.y=0;
                this.scroll(this.offset,this.to);
                b=true;
            }else{
                if(this.offset.y<-this.elem.scrollHeight+a.height-this.topOffset){
                    this.to.y=-this.elem.scrollHeight+a.height-this.topOffset;
                    this.scroll(this.offset,this.to);
                    b=true;
                }
            }
        }
}
if(this.scrollHorizontal()){
    if(this.offset.x==0){}else{
        if(this.offset.x>0){
            this.to.x=0;
            this.scroll(this.offset,this.to);
            b=true;
        }else{
            if(this.offset.x<-this.elem.scrollWidth+a.width){
                this.to.x=-this.elem.scrollWidth+a.width;
                this.scroll(this.offset,this.to);
                b=true;
            }
        }
    }
}
if(!b){
    this.scrolling=false;
    this.scroll.x=this.offset.x;
    this.scroll.y=this.offset.y;
    if(this.scrolled){
        if(!self.stopBubbling){
            this.onend.fire({
                offsetX:this.offset.x,
                offsetY:this.offset.y,
                direction:this.validDirection()
                });
        }
        if(this.bouncing){
            this.onbounceend.fire({
                offsetX:this.offset.x,
                offsetY:this.offset.y,
                direction:this.validDirection()
                });
            this.bouncing=false;
        }
    }
}
},
scroll:function(c,b){
    if(this.elem.timer!==undefined){
        return;
    }
    this.checkLimits();
    var a=this.parent.getInnerBox();
    this.from=c;
    if(this.scrollVertical()){
        if(b.y>0){
            this.to.y=0;
        }else{
            if(b.y<=this.limits.minTop){
                this.to.y=-this.elem.scrollHeight+a.height-this.topOffset;
            }else{
                this.to.y=b.y;
            }
        }
        this.startTime.y=(new Date()).getTime();
    this.timer.y=setInterval(this.step.bind(this),this.frameinterval);
}
if(this.scrollHorizontal()){
    if(b.x>0){
        this.to.x=0;
    }else{
        if(b.x<=this.limits.minLeft){
            this.to.x=-this.elem.scrollWidth+a.width;
        }else{
            this.to.x=b.x;
        }
    }
    if(this.to.x!=this.offset.x){
    this.startTime.x=(new Date()).getTime();
    this.timer.x=setInterval(this.step.bind(this),this.frameinterval);
}
}
},
move:function(g){
    var b=this.parent.getBox();
    var d={
        x:undefined,
        y:undefined
    };
    
    var f={
        x:this.offset.x,
        y:this.offset.y
        };
        
    if(typeof g==="string"){
        var a=document.getElementById(g);
        if(a){
            var e={
                x:0,
                y:0
            };
            
            var c=this;
            while(c.parent){
                e.x+=c.parent.getBox().left;
                e.y+=c.parent.getBox().top;
                c=c.parent;
            }
            d={
                x:-tactile.c.E.getOffsetLeft(a)+e.x,
                y:-tactile.c.E.getOffsetTop(a)+e.y
                };
            
    }else{
        tactile.logger.info(this.toString()+", show: "+this.inst.id+", from: "+this.from+", to: "+this.to);
        tactile.logger.warn("No element with the id "+g+" found !");
    }
}else{
    if(!isNaN(g.x)&&!isNaN(g.y)){
        d={
            x:this.offset.x+g.x,
            y:this.offset.y+g.y
            };
        
}
}
if(!isNaN(d.x)&&!isNaN(d.y)){
    this.scroll(f,d);
}
},
step:function(){
    var d,a,c,b=tactile.Device.browser.style;
    if(this.scrollVertical()&&this.timer.y!=null){
        d=(new Date()).getTime();
        if(d>=this.duration+this.startTime.y){
            c=this.to.y;
            clearInterval(this.timer.y);
            this.timer.y=null;
            setTimeout(this.onComplete.bind(this),20);
        }else{
            a=(d-this.startTime.y)/(this.duration);
            c=Math.round(this.transition(a)*(this.to.y-this.from.y)+this.from.y);
        }
        this.offset.y=c;
        this.scrolling=true;
        if(this.useTransform||this.useTransform3d){
            if(this.useTransform3d){
                if(this.scrollBoth()){
                    this.elem.style[b.transformProperty]="translate3d("+this.offset.x+tactile.Enum.Unit.px+","+this.offset.y+tactile.Enum.Unit.px+",0px)";
                }else{
                    this.elem.style[b.transformProperty]="translate3d(0"+tactile.Enum.Unit.px+","+this.offset.y+tactile.Enum.Unit.px+",0px)";
                }
            }else{
            if(this.scrollBoth()){
                this.elem.style[b.transformProperty]="translate("+this.offset.x+tactile.Enum.Unit.px+","+this.offset.y+tactile.Enum.Unit.px+")";
            }else{
                this.elem.style[b.transformProperty]="translate(0"+tactile.Enum.Unit.px+","+this.offset.y+tactile.Enum.Unit.px+")";
            }
        }
    }else{
    this.elem.style.top=this.offset.y+tactile.Enum.Unit.px;
}
}
if(this.scrollHorizontal()&&this.timer.x!=null){
    d=(new Date()).getTime();
    if(d>=this.duration+this.startTime.x){
        c=this.to.x;
        clearInterval(this.timer.x);
        this.timer.x=null;
        setTimeout(this.onComplete.bind(this),20);
    }else{
        a=(d-this.startTime.x)/(this.duration);
        c=Math.round(this.transition(a)*(this.to.x-this.from.x)+this.from.x);
    }
    this.offset.x=c;
    if(this.useTransform||this.useTransform3d){
        if(this.useTransform3d){
            if(this.scrollBoth()){
                this.elem.style[b.transformProperty]="translate3d("+this.offset.x+tactile.Enum.Unit.px+","+this.offset.y+tactile.Enum.Unit.px+",0px)";
            }else{
                this.elem.style[b.transformProperty]="translate3d("+this.offset.x+tactile.Enum.Unit.px+",0"+tactile.Enum.Unit.px+",0px)";
            }
        }else{
        if(this.scrollBoth()){
            this.elem.style[b.transformProperty]="translate("+this.offset.x+tactile.Enum.Unit.px+","+this.offset.y+tactile.Enum.Unit.px+")";
        }else{
            this.elem.style[b.transformProperty]="translate("+this.offset.x+tactile.Enum.Unit.px+",0"+tactile.Enum.Unit.px+")";
        }
    }
}else{
    this.elem.style.left=c+tactile.Enum.Unit.px;
}
}
this.onscroll.fire({
    offsetX:this.offset.x,
    offsetY:this.offset.y,
    direction:this.validDirection()
    });
},
update:function(){
    var a=this.validDirection(),b=tactile.Device.browser.style;
    if(a!=tactile.Enum.Scroll.disabled){
        if(this.state!=a){
            if(this.useTransform||this.useTransform3d){
                this.elem.style[b.transformProperty]="";
            }else{
                if(a===tactile.Enum.Scroll.vertical){
                    this.elem.style.left="0px";
                }else{
                    if(a===tactile.Enum.Scroll.horizontal){
                        this.elem.style.top="0px";
                    }
                }
            }
    }
if(this.scrolled){
    if(this.scrollbar){
        tactile.c.E.setOpacity(this.scrollbar.vBar,0);
        tactile.c.E.setOpacity(this.scrollbar.hBar,0);
    }
    this.onComplete();
}
}else{
    if(this.useTransform||this.useTransform3d){
        this.elem.style[b.transformProperty]="";
    }else{
        this.elem.style.left="0px";
        this.elem.style.top="0px";
    }
}
this.state=a;
},
onTouchMove:function(a){
    a.browserEvent.preventDefault();
    a.browserEvent.stopPropagation();
},
scrollBoundary:function(){
    var a=this.parent.getInnerBox();
    if(this.scrollVertical()){
        if(this.offset.y>0||this.offset.y<(-this.elem.scrollHeight+a.height-this.topOffset)){
            this.bouncing=true;
        }
    }
    if(this.scrollHorizontal()){
    if(this.offset.x>0||this.offset.x<(-this.elem.scrollWidth+a.width)){
        this.bouncing=true;
    }
}
if(this.bouncing){
    this.onbouncestart.fire({
        offsetX:this.offset.x,
        offsetY:this.offset.y,
        direction:this.validDirection()
        });
}
this.onComplete();
},
onTouchStart:function(a){
    a.browserEvent.preventDefault();
    a.browserEvent.stopPropagation();
},
toString:function(){
    var a="javascript (style)";
    var a="javascript (style)";
    if(this.useTransform3d){
        a="transform 3d";
    }else{
        if(this.useTransform){
            a="transform (2d)";
        }
    }
    return"Object - tactile.foundation.Scroller. Method: "+a+", Frames per sec.: "+this.fps;
}
});
tactile.foundation.ScrollBar=function(a,b){
    if(!a instanceof tactile.foundation.Scroller){
        throw tactile.errors.TypeError("tactile.foundation.ScrollBar","tactile.foundation.Scroller",typeof a);
    }
    this.scroller=a;
    this.scrollBarFixed=false;
    var c=document.createElement("div");
    c.style.padding=0;
    c.style.position=tactile.Enum.Position.absolute;
    c.style.backgroundColor=b.color||"#cccccc";
    c.style.zIndex=(tactile.c.E.getZindex(this.scroller.elem)+1).toString();
    c.style[tactile.Device.browser.style.borderRadius]="2"+tactile.Enum.Unit.em;
    tactile.c.E.setOpacity(c,0);
    this.vBar=c.cloneNode(true);
    this.hBar=c.cloneNode(true);
    if(typeof b.direction==="function"){
        this.getDirection=b.direction;
    }else{
        if(tactile.Enum.contains(tactile.Enum.Scroll,b.direction)){
            this.getDirection=function(){
                return tactile.Enum.getValue(tactile.Enum.Scroll,b.direction);
            };
        
    }else{
        this.getDirection=function(){
            return tactile.Enum.Scroll.vertical;
        };
    
}
}
this.weight=b.weight?b.weight:5;
this.scroller.onstart.subscribe(this.onStart,this);
this.scroller.onscroll.subscribe(this.onScroll,this);
this.scroller.onend.subscribe(this.onEnd,this);
};

tactile.foundation.ScrollBar.extend({
    validDirection:function(){
        var b,a;
        a="vertical";
        b=this.getDirection();
        if(tactile.Enum.contains(tactile.Enum.Scroll,b)){
            a=b;
        }
        return a;
    },
    fixScrollbar:function(){
        this.scroller.parent.elem.appendChild(this.vBar);
        this.scroller.parent.elem.appendChild(this.hBar);
        this.scrollBarFixed=true;
    },
    scrollVertical:function(){
        if(this.validDirection()==tactile.Enum.Scroll.vertical||this.validDirection()==tactile.Enum.Scroll.both){
            return true;
        }else{
            return false;
        }
    },
scrollHorizontal:function(){
    if(this.validDirection()==tactile.Enum.Scroll.horizontal||this.validDirection()==tactile.Enum.Scroll.both){
        return true;
    }else{
        return false;
    }
},
getZindex:function(){
    var b,a=0;
    var c=this.scroller.elem;
    b=tactile.c.E.getCurrStyle(c,"z-index");
    if(Number(b)){
        a=Number(b);
    }
    return a+1;
},
onStart:function(c){
    if(!this.scrollBarFixed){
        this.fixScrollbar();
    }
    var b=this.scroller.parent.getBox();
    this.vertRatio=b.height*100/this.scroller.elem.scrollHeight;
    this.horizRatio=b.width*100/this.scroller.elem.scrollWidth;
    var a=b.height*this.vertRatio/100;
    var d=b.width*this.horizRatio/100;
    if(this.scrollVertical()){
        this.vBar.style.width=this.weight+tactile.Enum.Unit.px;
        this.vBar.style.height=a+tactile.Enum.Unit.px;
        this.vBar.style.top=(this.vBar.offsetTop+b.top)+tactile.Enum.Unit.px;
        this.vBar.style.left=(this.scroller.elem.offsetLeft+this.scroller.elem.scrollWidth-this.vBar.offsetWidth-2)+tactile.Enum.Unit.px;
        if(this.vertRatio<100){
            tactile.c.E.setOpacity(this.vBar,60);
        }else{
            tactile.c.E.setOpacity(this.vBar,0);
        }
    }
    if(this.scrollHorizontal()){
    this.hBar.style.left=(this.hBar.offsetLeft+b.left)+tactile.Enum.Unit.px;
    this.hBar.style.top=(b.height-5)+tactile.Enum.Unit.px;
    this.hBar.style.width=d+tactile.Enum.Unit.px;
    this.hBar.style.height=this.weight+tactile.Enum.Unit.px;
    if(this.horizRatio<100){
        tactile.c.E.setOpacity(this.hBar,60);
    }else{
        tactile.c.E.setOpacity(this.hBar,0);
    }
}
},
onScroll:function(d){
    var b=Math.round(d.offsetX*this.horizRatio/100);
    var a=Math.round(d.offsetY*this.vertRatio/100);
    var c=this.scroller.parent.getBox();
    if(this.scrollVertical()){
        if(this.scroller.offset.y>=0){
            this.vBar.style.top=0+tactile.Enum.Unit.px;
        }else{
            if(this.scroller.offset.y<=-this.scroller.elem.scrollHeight+c.height){
                this.vBar.style.top=(c.height-this.vBar.offsetHeight)+tactile.Enum.Unit.px;
            }else{
                this.vBar.style.top=-a+tactile.Enum.Unit.px;
            }
        }
    }
if(this.scrollHorizontal()){
    if(this.scroller.offset.x>=0){
        this.hBar.style.left=0+tactile.Enum.Unit.px;
    }else{
        if(this.scroller.offset.x<=-this.scroller.elem.scrollWidth+c.width){
            this.hBar.style.left=(c.width-this.hBar.offsetWidth)+tactile.Enum.Unit.px;
        }else{
            this.hBar.style.left=-b+tactile.Enum.Unit.px;
        }
    }
}
},
onEnd:function(a){
    if(this.scrollVertical()){
        tactile.c.E.setOpacity(this.vBar,0);
    }
    if(this.scrollHorizontal()){
        tactile.c.E.setOpacity(this.hBar,0);
    }
}
});
tactile.foundation.Layouter=function(a){
    this.config=a||{};
    
    this.debug=false;
    this.device=undefined;
    this.orientation=undefined;
};

tactile.foundation.Layouter.extend({
    getDevice:function(){
        this.device="tablet";
        if(tactile.Device.isSmartphone){
            this.device="smartphone";
        }
    },
getOrientation:function(){
    this.orientation="portrait";
    if(tactile.Device.screen.isLandscape()){
        this.orientation="landscape";
    }
},
getValue:function(attribute,parent){
    this.getDevice();
    this.getOrientation();
    var val=this.config[this.device][this.orientation][attribute]||0;
    if(typeof(val)=="function"){
        val=val(parent);
    }else{
        if(typeof(val)=="string"){
            if(val.indexOf("%")<0||val.indexOf("%")!=(val.length-1)){
                val=eval("(function (parent) { return "+val+"})(parent);");
            }else{}
        }else{
        if(typeof(val)=="boolean"){
            return val;
        }else{
            if(typeof(val)!="number"){
                throw new tactile.errors.ArgumentUndefined("Layouter.config["+this.device+"]["+this.orientation+"]["+attribute+"] = "+val);
            }
        }
    }
}
tactile.logger.info("Layouter.config["+this.device+"]["+this.orientation+"]["+attribute+"] = "+val);
return val;
},
getTop:function(a){
    var b=this.getValue("top",a);
    tactile.logger.info("Layouter.getTop() = "+b);
    return b;
},
getLeft:function(a){
    var b=this.getValue("left",a);
    tactile.logger.info("Layouter.Left() = "+b);
    return b;
},
getWidth:function(a){
    this.parent=a;
    var b=this.getValue("width",a);
    tactile.logger.info("Layouter.getWidth() = "+b);
    return b;
},
getHeight:function(a){
    var b=this.getValue("height",a);
    tactile.logger.info("Layouter.getHeight() = "+b);
    return b;
},
getVisibility:function(a){
    var b=this.getValue("visibility",a);
    if(b!=true){
        b=false;
    }
    tactile.logger.info("Layouter.getVisibility() = "+b);
    return b;
},
getItemwidth:function(a){
    var b=this.getValue("itemwidth",a);
    tactile.logger.info("Layouter.getItemheight() = "+b);
    return b;
},
getItemheight:function(a){
    var b=this.getValue("itemheight",a);
    tactile.logger.info("Layouter.getItemwidth() = "+b);
    return b;
}
});
tactile.foundation.ImageScaler=(function(){
    var Imagescaler=function(){
        this.loadingmask_latency=100;
        this.latency=50;
        this.onimageload=new tactile.foundation.Observer();
        this.oninit=new tactile.foundation.Observer();
        this.onready=new tactile.foundation.Observer();
        this.imagestoload=undefined;
        this.portraitimagestoload=undefined;
        this.landscapeimagestoload=undefined;
        this.startLandscape=false;
        this.startPortrait=false;
        this.onreadyfired=false;
        this.imagestoscale=[];
        this.imagestoscalelazy=[];
        this.onreadytimer=undefined;
        return this;
    };
    
    Imagescaler.extend({
        getLoadingmaskCls:function(view){
            if(!view){
                return;
            }
            if(view.loadingmaskCls==undefined){
                view.loadingmaskCls=false;
                var match=view.elem.className.match(/(loadingmask_\w+|loadingmask)/);
                if(match&&match[0]){
                    view.loadingmaskCls=match[0];
                }
            }
            return view.loadingmaskCls;
    },
    hideLoadingmask:function(){
        this.style.visibility="visible";
        if(!this.imagescaler){
            return;
        }
        window.setTimeout((function(){
            var cls=this.imagescaler.getLoadingmaskCls(this.view);
            if(cls){
                if(tactile.c!=undefined){
                    tactile.c.E.removeClass(this.view.elem,cls);
                }else{
                    if(tactile.c!=undefined){
                        tactile.c.E.removeClass(this.view.elem,cls);
                    }
                }
            }
        this.imagescaler.loadingmask_latency=0;
        }).bind(this),this.imagescaler.loadingmask_latency);
},
showLoadingmask:function(){
    this.style.visibility="hidden";
    var cls=this.imagescaler.getLoadingmaskCls(this.view);
    if(cls){
        if(tactile.c!=undefined){
            tactile.c.E.addClass(this.view.elem,cls);
        }else{
            if(tactile.c!=undefined){
                tactile.c.E.addClass(this.view.elem,cls);
            }
        }
    }
},
extractParams:function(delimiter,url,params){
    tokes=url.split(delimiter);
    for(var i=1;i<tokes.length;i++){
        nv=tokes[i].split("=");
        params[nv[0].toLowerCase()]=nv[1];
    }
    return params;
},
getImgUrl:function(src){
    return decodeURIComponent(src.substr(src.indexOf("url")+4));
},
getParams:function(src,_params){
    var params=_params||{};
    
    var url=this.getImgUrl(src);
    if(url&&url.match(/;/)){
        params=this.extractParams(";",url,params);
    }
    return params;
},
cleansrc:function(src){
    var url=this.getImgUrl(src);
    if(url){
        matches=url.match(/&|;/);
        if(matches){
            var delimiter=matches[0];
            src=src.substr(0,src.indexOf("url"))+"url="+url.substr(0,url.indexOf(delimiter));
        }
    }
    return src;
},
getOffsets:function(src,e){
    var eventdata=e||{
        height:0,
        width:0
    };
    
    var orientation=this.getOrientation();
    var w,h;
    var params=this.getParams(src,{
        width:undefined,
        height:undefined
    });
    w=eventdata.width;
    h=eventdata.height;
    if(h>0&&params.width=="auto"){
        w=10000;
    }
    if(w>0&&params.height=="auto"){
        h=10000;
    }
    if(parseInt(params.width)==params.width){
        w=params.width;
    }
    if(parseInt(params.height)==params.height){
        h=params.height;
    }
    var out={
        params:params,
        eventdata:eventdata,
        orientation:orientation,
        w:w,
        h:h
    };
    
    return out;
},
updateStyleCenter:function(){
    with(this.style){
        position="absolute";
        left=(((this.offsetWidth*0.5)-(this.offsets.eventdata.width*0.5))*-1)+"px";
        top=(((this.offsetHeight*0.5)-(this.offsets.eventdata.height*0.5))*-1)+"px";
        }
    },
updateViewPosition:function(){
    var position=tactile.c.E.getCurrStyle(this.elem,"position");
    if(position=="static"){
        this.elem.style.position="relative";
    }
},
updateStyle:function(w,h,offsets){
    var need=0;
    if(w>0){
        this.style.width=w+tactile.Enum.Unit.px;
    }
    if(h>0){
        this.style.height=h+tactile.Enum.Unit.px;
    }
    if((offsets.params.cliptop!=undefined&&offsets.params.cliptop=="true")||(offsets.params.clipleft!=undefined&&offsets.params.clipleft=="true")||(offsets.params.clipbottom!=undefined&&offsets.params.clipbottom=="true")||(offsets.params.clipright!=undefined&&offsets.params.clipright=="true")||(offsets.params.clipcenter!=undefined&&offsets.params.clipcenter=="true")){
        if(this.parentNode.tagName=="A"){
            this.parentNode.parentNode.parentNode.style.overflow="hidden";
            this.parentNode.parentNode.parentNode.style.position="relative";
        }else{
            this.parentNode.parentNode.style.overflow="hidden";
            this.parentNode.parentNode.style.position="relative";
        }
    }
    if((offsets.params.cliptop!=undefined&&offsets.params.cliptop=="true")||(offsets.params.alignbottom!=undefined&&offsets.params.alignbottom=="true")){
    with(this.style){
        position="absolute";
        bottom="0px";
        }
        need=-1;
    this.imagescaler.updateViewPosition.call(this.view);
}
if((offsets.params.clipbottom!=undefined&&offsets.params.clipbottom=="true")||(offsets.params.aligntop!=undefined&&offsets.params.aligntop=="true")){
    with(this.style){
        position="absolute";
        top="0px";
        }
        need=-1;
    this.imagescaler.updateViewPosition.call(this.view);
}
if((offsets.params.clipleft!=undefined&&offsets.params.clipleft=="true")||(offsets.params.alignright!=undefined&&offsets.params.alignright=="true")){
    with(this.style){
        position="absolute";
        right="0px";
        }
        need++;
    this.imagescaler.updateViewPosition.call(this.view);
}
if((offsets.params.clipright!=undefined&&offsets.params.clipright=="true")||(offsets.params.alignleft!=undefined&&offsets.params.alignleft=="true")){
    with(this.style){
        position="absolute";
        left="0px";
        }
        need++;
    this.imagescaler.updateViewPosition.call(this.view);
}
if((offsets.params.clipcenter!=undefined&&offsets.params.clipcenter=="true")||(offsets.params.center!=undefined&&offsets.params.center=="true")||(offsets.params.aligncenter!=undefined&&offsets.params.aligncenter=="true")){
    this.offsets=offsets;
    this.imagescaler.updateViewPosition.call(this.view);
    if(this.complete){
        this.imagescaler.updateStyleCenter.call(this);
    }else{
        this.addEventListener("load",function(){
            this.imagescaler.updateStyleCenter.call(this);
            this.removeEventListener("load",arguments.callee);
        });
    }
}else{
    if(need<0){
        this.style.left="0px";
    }
}
},
updateHandler:function(){
    var par=this;
    var isc=par.imagescaler;
    var offsets=isc.getOffsets(this.targetsrc,par.view.getInnerBox());
    if(offsets.w<1&&offsets.h<1){
        return;
    }
    var imb={};
    
    if(tactile.Device.screen.isLandscape()){
        imb.width=this.landscape.naturalWidth;
        imb.height=this.landscape.naturalHeight;
    }else{
        imb.width=this.portrait.naturalWidth;
        imb.height=this.portrait.naturalHeight;
    }
    var ima1={};
    
    ima1.width=(offsets.w>=imb.width?imb.width:offsets.w);
    ima1.height=imb.height*(ima1.width/imb.width);
    var ima2={};
    
    ima2.height=(offsets.h>=imb.height?imb.height:offsets.h);
    ima2.width=imb.width*(ima2.height/imb.height);
    if(offsets.h>=ima1.height){
        ima={
            width:ima1.width,
            height:ima1.height
            };
        
}else{
    ima={
        width:ima2.width,
        height:ima2.height
        };
    
}
isc.updateStyle.apply(par,[ima.width,ima.height,offsets]);
},
getOrientation:function(){
    if(tactile.Device.screen.isLandscape()){
        return"landscape";
    }
    if(tactile.Device.screen.isPortrait()){
        return"portrait";
    }
},
baseName:function(url){
    var fileName=url.substring(url.lastIndexOf("/")+1);
    var dot=fileName.lastIndexOf(".");
    return dot==-1?fileName:fileName.substring(0,dot);
},
run:function(node){
    var target=node||document;
    var params={};
    
    var images=target.querySelectorAll("img[altsrc]");
    for(var i=0;i<images.length;i++){
        images[i].targetsrc=images[i].getAttribute("altsrc");
        images[i].removeAttribute("altsrc");
        if(images[i].getAttribute("alt")!=""){
            images[i].screenname=images[i].getAttribute("alt");
        }else{
            images[i].screenname=this.baseName(this.getImgUrl(this.cleansrc(images[i].targetsrc)));
        }
        var pnode=images[i].parentNode;
        var tagName=pnode.tagName.toLowerCase();
        while(pnode&&!tactile.page.isComponent(pnode.id)&&!(tactile.page.getComponent(pnode.id) instanceof tactile.View)){
            pnode=pnode.parentNode;
        }
        var pNodeComp=undefined;
        if(pnode){
            pNodeComp=tactile.page.getComponent(pnode.id);
        }
        if(pNodeComp&&(typeof(pNodeComp.configVisible)!=="function"||pNodeComp.configVisible()==true)){
            params=this.getParams(images[i].targetsrc);
            if(params.lazyload&&params.lazyload=="true"){
                images[i].lazyload=true;
                this.imagestoscalelazy.push({
                    node:pNodeComp,
                    img:images[i]
                    });
            }else{
                images[i].lazyload=false;
                this.imagestoscale.push({
                    node:pNodeComp,
                    img:images[i]
                    });
            }
        }
        if(!pNodeComp){
        this.onimageload.fire({
            id:null,
            index:0,
            length:0,
            img:null
        });
        this.hideLoadingmask.call(images[i]);
        images[i].src=this.cleansrc(images[i].targetsrc);
    }
    }
    this.setup();
return target;
},
setup:function(){
    this.portraitimagestoload=this.imagestoscale.length;
    this.landscapeimagestoload=this.imagestoscale.length;
    this.imagestoload=2*this.imagestoscale.length;
    this.oninit.fire({
        orientation:this.getOrientation(),
        index:(2*this.imagestoscale.length)-this.imagestoload,
        length:(2*this.imagestoscale.length)
        });
    if(this.imagestoscale.length>0){
        for(var i=0;i<this.imagestoscale.length;i++){
            this.imagestoscale[i].img.src="";
            this.init(this.imagestoscale[i].node,this.imagestoscale[i].img);
        }
        }else{
    this.onimageload.fire({
        id:null,
        index:0,
        length:0,
        img:null
    });
}
for(var i=0;i<this.imagestoscalelazy.length;i++){
    this.init(this.imagestoscalelazy[i].node,this.imagestoscalelazy[i].img);
}
},
init:function(view,image){
    image.view=view;
    image.imagescaler=this;
    image.orientation=undefined;
    var onErrorHandler=function(){
        var par=this.parentimage;
        var isc=par.imagescaler;
        par.hasError=true;
        isc.finalize.call(this);
    };
    
    var onLoadHandler=function(){
        var par=this.parentimage;
        var isc=par.imagescaler;
        par.hasError=false;
        if(!this.complete){
            return;
        }
        this.loaded=true;
        par.removeAttribute("width");
        par.removeAttribute("height");
        if(isc.getOrientation()==this.orientation){
            par.src=this.src;
            isc.updateHandler.call(par);
        }
        isc.hideLoadingmask.call(par);
        isc.finalize.call(this);
    };
    
    image.landscape=new Image;
    image.landscape.orientation="landscape";
    image.landscape.targetsrc=image.targetsrc;
    image.landscape.parentimage=image;
    image.landscape.loaded=false;
    image.landscape.addEventListener("error",onErrorHandler);
    image.landscape.addEventListener("load",onLoadHandler);
    image.portrait=new Image;
    image.portrait.orientation="portrait";
    image.portrait.targetsrc=image.targetsrc;
    image.portrait.parentimage=image;
    image.portrait.loaded=false;
    image.portrait.addEventListener("error",onErrorHandler);
    image.portrait.addEventListener("load",onLoadHandler);
    view.image=image;
    view.imagescaler=this;
    view.onstatechange.subscribe(this.initHandler,view);
    view.onresize.subscribe(this.initHandler,view);
    view.onresize.subscribe(this.updateHandler.bind(image));
},
initHandler:function(e){
    var isc=this.imagescaler;
    if(isc.onreadyfired==true&&((isc.getOrientation()=="portrait"&&isc.portraitimagestoload>0)||(isc.getOrientation()=="landscape"&&isc.landscapeimagestoload>0))){
        isc.onreadyfired=false;
        isc.oninit.fire({
            orientation:isc.getOrientation(),
            index:(2*isc.imagestoscale.length)-isc.imagestoload,
            length:(2*isc.imagestoscale.length)
            });
    }
    switch(this.state){
        case"hidden":case"hiding":
            return;
            break;
        case"showing":
            this.onstatechange.subscribe((function(){
            window.setTimeout((function(){
                this.imagescaler.initHandler.call(this);
            }).bind(this),this.imagescaler.latency);
            this.onstatechange.unsubscribe(arguments.callee);
        }).bind(this));
            return;
            break;
    }
    var loadHandler=function(){
        if(this.timer){
            window.clearTimeout(this.timer);
        }
        var par=this.parentimage;
        var isc=par.imagescaler;
        if(this.offsets.orientation=="landscape"){
            isc.startedLandscape=true;
        }
        if(this.offsets.orientation=="portrait"){
            isc.startedPortrait=true;
        }
        var dpr=1;
        if(window.devicePixelRatio!==undefined){
            dpr=window.devicePixelRatio;
        }
        this.newsrc=isc.cleansrc(par.targetsrc).replace(/height=\d+/gi,"height="+(this.offsets.h*dpr)).replace(/width=\d+/gi,"width="+(this.offsets.w*dpr));
        this.timer=window.setTimeout((function(){
            if(this.src!=this.newsrc){
                isc.showLoadingmask.call(par);
                this.src=this.newsrc;
            }
        }).bind(this),isc.latency);
};

var offsets=this.imagescaler.getOffsets(this.image.targetsrc,this.getInnerBox());
if(offsets.orientation=="landscape"&&this.image.landscape.loaded){
    this.image.src=this.image.landscape.src;
    isc.updateHandler.call(this.image);
}else{
    if(offsets.orientation=="portrait"&&this.image.portrait.loaded){
        this.image.src=this.image.portrait.src;
        isc.updateHandler.call(this.image);
    }else{
        if(offsets.w>0&&offsets.h>0&&offsets.orientation=="landscape"&&!this.image.landscape.loaded){
            this.image.landscape.offsets=offsets;
            loadHandler.call(this.image.landscape);
        }else{
            if(offsets.w>0&&offsets.h>0&&offsets.orientation=="portrait"&&!this.image.portrait.loaded){
                this.image.portrait.offsets=offsets;
                loadHandler.call(this.image.portrait);
            }
        }
    }
}
},
onreadyHandler:function(){
    if(this.onreadytimer){
        window.clearTimeout(this.onreadytimer);
    }
    var timerCallback=function(){
        this.onreadyfired=true;
        this.onready.fire({
            orientation:this.getOrientation(),
            index:(2*this.imagestoscale.length)-this.imagestoload,
            length:(2*this.imagestoscale.length)
            });
    };
    
    this.onreadytimer=window.setTimeout(timerCallback.bind(this),this.latency);
},
finalize:function(){
    var par=this.parentimage;
    var isc=par.imagescaler;
    var rest;
    if(!par.lazyload){
        if(this.orientation=="landscape"){
            isc.landscapeimagestoload--;
        }else{
            isc.portraitimagestoload--;
        }
        isc.imagestoload--;
        isc.onimageload.fire({
            id:par.id,
            index:(2*isc.imagestoscale.length)-isc.imagestoload,
            length:(2*isc.imagestoscale.length),
            orientation:this.orientation,
            img:par
        });
        if(!isc.onreadyfired){
            if(isc.startedPortrait&&isc.startedLandscape&&isc.imagestoload==0){
                isc.onreadyHandler.call(isc);
            }else{
                if(((isc.startedPortrait&&!isc.startedLandscape)||(isc.startedLandscape&&!isc.startedPortrait))&&(isc.imagestoscale.length-(isc.imagestoload))==0){
                    isc.onreadyHandler.call(isc);
                }
            }
        }
}
return true;
}
});
return new Imagescaler();
})();
tactile.foundation.Element=function(){
    this.elem=undefined;
    this.init=function(a){
        if(typeof a==="string"){
            this.elem=document.getElementById(a);
        }else{
            this.elem=a;
        }
        if(!this.elem){
            throw new tactile.errors.ArgumentUndefined("tactile.foundation.Element.init","elem");
        }
        this.elem.displayStyle=this.elem.style.display;
    };

};

tactile.foundation.Element.extend({
    hide:function(a){
        this.elem.style.display=tactile.Enum.Display.none;
    },
    show:function(){
        this.elem.style.display=this.elem.displayStyle;
    },
    toggle:function(){
        if(this.elem.style.display==tactile.Enum.Display.none){
            this.show();
        }else{
            this.hide();
        }
    },
setOpacity:function(a){
    tactile.c.E.setOpacity(this.elem,a);
},
getOpacity:function(){
    return tactile.c.E.getOpacity(this.elem);
},
addClass:function(a){
    tactile.c.E.addClass(this.elem,a);
},
removeClass:function(a){
    tactile.c.E.removeClass(this.elem,a);
},
replaceClass:function(b,a){
    tactile.c.E.replaceClass(this.elem,b,a);
},
toggleClass:function(a){
    tactile.c.E.toggleClass(this.elem,a);
},
swapClass:function(b,a){
    tactile.c.E.swapClass(this.elem,b,a);
},
isVisible:function(){
    return(this.elem.style.display!=tactile.Enum.Display.none)&&(tactile.c.E.getCurrStyle(this.elem,"display")!=tactile.Enum.Display.none);
}
});
tactile.foundation.UIElement=function(a){
    tactile.foundation.UIElement.prototype.init.call(this,a);
};

tactile.foundation.UIElement.prototype=new tactile.foundation.Element();
tactile.foundation.UIElement.prototype.toString=function(){
    return"Object - tactile.foundation.UIElement";
};

tactile.foundation.UIComponent=function(){
    this.effect=undefined;
    this.aftershow=undefined;
    this.beforeshow=undefined;
    this.afterhide=undefined;
    this.beforehide=undefined;
    this.init=function(a){
        tactile.foundation.UIComponent.prototype.init.call(this,a);
        if(this.elem.id){
            this.id=this.elem.id;
        }else{
            this.id=this.elem.id=tactile.foundation.UIComponent.getNewId();
        }
        tactile.foundation.UIComponent.components[this.id]=this;
    };

};

tactile.foundation.UIComponent.prototype=new tactile.foundation.Element();
tactile.foundation.UIComponent.idSeed=0;
tactile.foundation.UIComponent.getNewId=function(){
    return"UID_"+(tactile.foundation.UIComponent.idSeed+=1);
};

tactile.foundation.UIComponent.components={};
    
tactile.foundation.UIComponent.extend({
    hide:function(a){
        if(this.effect&&this.effect.hide){
            if(this.effect.op==tactile.effects.Operations.none){
                if(this.beforehide){
                    this.beforehide.fire({
                        targetId:this.id
                        });
                }
                this.effect.hide(a);
            }
        }else{
        if(this.beforehide){
            this.beforehide.fire({
                targetId:this.id
                });
        }
        this.elem.style.display=tactile.Enum.Display.none;
        if(this.afterhide){
            this.afterhide.fire({
                targetId:this.id
                });
        }
    }
    if(this.scroller){
    this.scroller.scrollBoundary();
}
},
show:function(a){
    if(this.effect&&this.effect.show){
        if(this.effect.op==tactile.effects.Operations.none){
            if(this.beforeshow){
                this.beforeshow.fire({
                    targetId:this.id
                    });
            }
            this.effect.show(a);
        }
    }else{
    if(this.beforeshow){
        this.beforeshow.fire({
            targetId:this.id
            });
    }
    this.elem.style.display=this.elem.displayStyle;
    if(tactile.Device.platform==="ios"&&tactile.Device.version>=5){
        tactile.c.U.updateRenderTreeFix();
    }
    if(this.aftershow){
        this.aftershow.fire({
            targetId:this.id
            });
    }
}
},
toggle:function(a){
    if(this.elem.style.display==tactile.Enum.Display.none){
        this.show(a);
    }else{
        this.hide(a);
    }
},
append:function(a){
    if(a instanceof tactile.foundation.UIComponent){
        if(this instanceof tactile.FlexView||this instanceof tactile.GridView||this instanceof tactile.View){
            var b=this.elem.childNodes[1]||this.elem.childNodes[0];
            b.appendChild(a.elem);
        }else{
            this.elem.appendChild(a.elem);
        }
    }else{
    tactile.logger.error(this.id+" Type mismatch: tactile.foundation.UIComponent.append expects argument of type tactile.foundation.UIComponent!");
}
},
prepend:function(a){
    if(a instanceof tactile.foundation.UIComponent){
        if(this instanceof tactile.FlexView||this instanceof tactile.GridView||this instanceof tactile.View){
            var b=this.elem.childNodes[1]||this.elem.childNodes[0];
            b.insertBefore(a.elem,b.childNodes[0]);
        }else{
            this.elem.insertBefore(a.elem,this.elem.childNodes[0]);
        }
    }else{
    tactile.logger.error(this.id+" Type mismatch: tactile.foundation.UIComponent.prepend expects argument of type tactile.foundation.UIComponent!");
}
},
getChildren:function(e){
    if(!e){
        var e=new Array();
    }
    if(this.elem){
        if(this.elem.hasChildNodes()){
            var c;
            if(this instanceof tactile.FlexView||this instanceof tactile.GridView||this instanceof tactile.View){
                var d=this.elem.childNodes[1]||this.elem.childNodes[0];
                c=d.childNodes;
            }else{
                c=this.elem.childNodes;
            }
            var a=null;
            for(var b=0;b<c.length;b++){
                if(c[b].id&&tactile.page.isComponent(c[b].id)){
                    a=tactile.page.getComponent(c[b].id);
                    e.push(a);
                    tactile.foundation.UIComponent.prototype.getChildren.call(a,e);
                }
            }
            }
    }
return e;
},
remove:function(a){
    function b(g){
        var f=g.getChildren();
        if(f.length>0){
            for(var e=0;e<f.length;e++){
                delete tactile.foundation.UIComponent.components[f[e].id];
            }
            }
        }
if(a instanceof tactile.foundation.UIComponent&&a.parent&&this.id===a.parent.id){
    try{
        b(a);
        if(this instanceof tactile.FlexView||this instanceof tactile.GridView||this instanceof tactile.View){
            var c=this.elem.childNodes[1]||this.elem.childNodes[0];
            c.removeChild(a.elem);
        }else{
            this.elem.removeChild(a.elem);
        }
        if(tactile.foundation.UIComponent.components[a.id]){
            delete tactile.foundation.UIComponent.components[a.id];
        }
    }catch(d){
    tactile.logger.error("tactile.foundation.UIComponent.remove  the component is not a child of "+this.id);
}
}else{
    tactile.logger.error(this.id+" Type mismatch: tactile.foundation.UIComponent.remove  expects argument of type tactile.foundation.UIComponent!");
}
}
});
tactile.foundation.UIContainer=function(){
    this.parent=undefined;
    this.configWidth=undefined;
    this.configHeight=undefined;
    this.configTop=undefined;
    this.configLeft=undefined;
    this.configVisible=undefined;
    this.onresize=undefined;
    this.onstatechange=undefined;
    this.init=function(f,b){
        tactile.foundation.UIContainer.prototype.init.call(this,f);
        b=b||{};
        
        if(!b.zindex&&tactile.Device.platform==="ios"&&tactile.Device.version<4){
            b.zindex=1;
        }
        this.innerDiv=null;
        if(this instanceof tactile.View||this instanceof tactile.FlexView||this instanceof tactile.GridView){
            this.innerDiv=this.elem.childNodes[1];
        }
        if(b.width){
            if(typeof b.width==="function"){
                this.configWidth=b.width;
            }else{
                if(!isNaN(b.width)){
                    this.configWidth=function(h){
                        return b.width;
                    };
                
            }
        }
    }
if(b.height){
    if(typeof b.height==="function"){
        this.configHeight=b.height;
    }else{
        if(!isNaN(b.height)){
            this.configHeight=function(h){
                return b.height;
            };
        
    }
}
}
if(b.top){
    if(typeof b.top==="function"){
        this.configTop=b.top;
    }else{
        if(!isNaN(b.top)){
            this.configTop=function(h){
                return b.top;
            };
        
    }
}
}
if(b.left){
    if(typeof b.left==="function"){
        this.configLeft=b.left;
    }else{
        if(!isNaN(b.left)){
            this.configLeft=function(h){
                return b.left;
            };
        
    }
}
}
if(b.visible!==undefined){
    if(typeof b.visible==="function"){
        this.configVisible=b.visible;
    }
}
if(b.effect){
    var e=undefined;
    var d="",g="",a="",c=tactile.effects.Method.disabled.toLowerCase();
    if(typeof nbdevice==="object"){
        d=nbdevice.tactileslidemethod?nbdevice.tactileslidemethod.toLowerCase():"";
        g=nbdevice.tactilefademethod?nbdevice.tactilefademethod.toLowerCase():"";
        a=nbdevice.tactileexpandmethod?nbdevice.tactileexpandmethod.toLowerCase():"";
    }
    if(b.effect.type&&(b.effect.type==tactile.Enum.Effects.slide)&&(d!==c)){
        e=new tactile.effects.Slide(this,b.effect);
    }else{
        if(b.effect.type&&(b.effect.type==tactile.Enum.Effects.expand)&&(g!==c)){
            e=new tactile.effects.Expand(this,b.effect);
        }else{
            if(b.effect.type&&(b.effect.type==tactile.Enum.Effects.fade)&&(a!==c)){
                e=new tactile.effects.Fade(this,b.effect);
            }
        }
    }
if(e!==undefined){
    this.effect=e;
    tactile.logger.info(this.toString()+", effect: "+this.effect.toString());
}else{
    delete b.effect;
}
}
if(b.position&&tactile.Enum.contains(tactile.Enum.Position,b.position)){
    this.elem.style.position=tactile.Enum.getValue(tactile.Enum.Position,b.position);
}
if(b.overflow&&tactile.Enum.contains(tactile.Enum.Overflow,b.overflow)){
    this.elem.style.overflow=tactile.Enum.getValue(tactile.Enum.Overflow,b.overflow);
}
if(b.zindex&&!isNaN(b.zindex)){
    this.elem.style.zIndex=b.zindex;
}
if(b.display&&tactile.Enum.contains(tactile.Enum.Display,b.display)){
    this.elem.style.display=tactile.Enum.getValue(tactile.Enum.Display,b.display);
}
if(b.float&&tactile.Enum.contains(tactile.Enum.Float,b.float)){
    this.elem.style.cssFloat=tactile.Enum.getValue(tactile.Enum.Float,b.float);
}
if(b.opacity&&!isNaN(b.opacity)){
    this.setOpacity(b.opacity);
}
if(b.events){
    this.applyEvents(b.events);
}
};

};

tactile.foundation.UIContainer.prototype=new tactile.foundation.UIComponent();
tactile.foundation.UIContainer.extend({
    applyEvents:function(c){
        this.attributeEvents=c;
        var a=this;
        for(var b in this.attributeEvents){
            (function(d){
                tactile.EventManager.addListener(a.id,d,function(g){
                    if(typeof a.attributeEvents[d]==="string"){
                        try{
                            a.attributeEvents[d]=tactile.c.U.attrValidator.validate(a.attributeEvents[d]);
                        }catch(g){
                            console.log(g);
                        }
                    }
                    var f=a.attributeEvents[d];
                f.component[f.endFunction].apply(f.component,f.functionArguments);
                }.bind(a));
            })(b);
            }
        },
validateNumber:function(b,d){
    var a=null;
    if(b){
        try{
            a=b.call(this,d);
        }catch(c){
            tactile.logger.error(this.id+".validateNumber("+b+", "+d+") has thrown an exception: "+c);
        }
        if(!isNaN(a)){
            return a;
        }else{
            tactile.logger.error(this.id+".validateNumber("+b+", "+d+") did not return a number!");
            a=null;
        }
    }
    return a;
},
validateVisible:function(){
    var a=true;
    if(this.configVisible){
        try{
            a=this.configVisible();
        }catch(b){
            tactile.logger.error(this.id+".validateVisible("+this.configVisible+") has thrown an exception: "+b);
            a=true;
        }
        if(typeof a==="boolean"){
            return a;
        }else{
            tactile.logger.error(this.id+".validateVisible("+this.configVisible+") did not return a boolean value!");
            a=true;
        }
        if(!a){
            tactile.logger.warn(this.id+".validateVisible returned false!");
        }
    }
    return a;
},
getBox:function(){
    var a={
        top:this.elem.offsetTop,
        left:this.elem.offsetLeft,
        width:this.elem.offsetWidth,
        height:this.elem.offsetHeight
        };
        
    return a;
},
getParentBox:function(){
    if(this.parent&&this.parent.getBox){
        return this.parent.getBox();
    }else{
        return{
            top:0,
            left:0,
            width:tactile.Device.screen.getWidth(),
            height:tactile.Device.screen.getHeight()
            };
        
}
},
getParentInnerBox:function(){
    if(this.parent&&this.parent.getInnerBox){
        return this.parent.getInnerBox();
    }else{
        return{
            top:0,
            left:0,
            width:tactile.Device.screen.getWidth(),
            height:tactile.Device.screen.getHeight()
            };
        
}
},
getInnerBox:function(){
    var b={
        left:tactile.c.E.getStyleValue(this.elem,"border-left-width"),
        right:tactile.c.E.getStyleValue(this.elem,"border-right-width"),
        top:tactile.c.E.getStyleValue(this.elem,"border-top-width"),
        bottom:tactile.c.E.getStyleValue(this.elem,"border-bottom-width")
        };
        
    var d={
        left:tactile.c.E.getStyleValue(this.elem,"margin-left"),
        right:tactile.c.E.getStyleValue(this.elem,"margin-right"),
        top:tactile.c.E.getStyleValue(this.elem,"margin-top"),
        bottom:tactile.c.E.getStyleValue(this.elem,"margin-bottom")
        };
        
    var e={
        left:tactile.c.E.getStyleValue(this.elem,"padding-left"),
        right:tactile.c.E.getStyleValue(this.elem,"padding-right"),
        top:tactile.c.E.getStyleValue(this.elem,"padding-top"),
        bottom:tactile.c.E.getStyleValue(this.elem,"padding-bottom")
        };
        
    if(tactile.foundation.LayoutManager.loaded){
        this.getInnerBox=function(){
            var g=this.getOuterBox();
            var f={
                width:(g.width-b.left-b.right-d.left-d.right-e.left-e.right),
                height:(g.height-b.top-b.bottom-d.left-d.bottom-e.left-e.right),
                left:(e.left),
                top:(e.top)
                };
                
            return f;
        };
        
        return this.getInnerBox();
    }
    var c=this.getOuterBox();
    var a={
        width:(c.width-b.left-b.right-d.left-d.right-e.left-e.right),
        height:(c.height-b.top-b.bottom-d.left-d.bottom-e.left-e.right),
        left:(e.left),
        top:(e.top)
        };
        
    return a;
},
getOuterBox:function(){
    var c={
        left:tactile.c.E.getStyleValue(this.elem,"margin-left"),
        right:tactile.c.E.getStyleValue(this.elem,"margin-right"),
        top:tactile.c.E.getStyleValue(this.elem,"margin-top"),
        bottom:tactile.c.E.getStyleValue(this.elem,"margin-bottom")
        };
        
    if(tactile.foundation.LayoutManager.loaded){
        this.getOuterBox=function(){
            var e=this.getBox();
            var d={
                width:(e.width+c.left+c.right),
                height:(e.height+c.top+c.bottom),
                left:(e.left),
                top:(e.top)
                };
                
            return d;
        };
        
        return this.getOuterBox();
    }
    var b=this.getBox();
    var a={
        width:(b.width+c.left+c.right),
        height:(b.height+c.top+c.bottom),
        left:(b.left),
        top:(b.top)
        };
        
    return a;
},
getBoxOffset:function(){
    var e={
        left:tactile.c.E.getStyleValue(this.elem,"margin-left"),
        right:tactile.c.E.getStyleValue(this.elem,"margin-right"),
        top:tactile.c.E.getStyleValue(this.elem,"margin-top"),
        bottom:tactile.c.E.getStyleValue(this.elem,"margin-bottom")
        };
        
    var c={
        left:tactile.c.E.getStyleValue(this.elem,"border-left-width"),
        right:tactile.c.E.getStyleValue(this.elem,"border-right-width"),
        top:tactile.c.E.getStyleValue(this.elem,"border-top-width"),
        bottom:tactile.c.E.getStyleValue(this.elem,"border-bottom-width")
        };
        
    var f={
        left:tactile.c.E.getStyleValue(this.elem,"padding-left"),
        right:tactile.c.E.getStyleValue(this.elem,"padding-right"),
        top:tactile.c.E.getStyleValue(this.elem,"padding-top"),
        bottom:tactile.c.E.getStyleValue(this.elem,"padding-bottom")
        };
        
    if(tactile.foundation.LayoutManager.loaded){
        this.getBoxOffset=function(){
            var k=0;
            var l=0;
            if(this.parent){
                var i=this.parent.getTopLefOffset();
                k=i.top;
                l=i.left;
            }
            var h={
                width:e.left+e.right+c.left+c.right+f.left+f.right,
                height:e.top+e.bottom+c.top+c.bottom+f.top+f.bottom,
                top:k,
                left:l
            };
            
            return h;
        };
        
        return this.getBoxOffset();
    }
    var d=0;
    var g=0;
    if(this.parent){
        var b=this.parent.getTopLefOffset();
        d=b.top;
        g=b.left;
    }
    var a={
        width:e.left+e.right+c.left+c.right+f.left+f.right,
        height:e.top+e.bottom+c.top+c.bottom+f.top+f.bottom,
        top:d,
        left:g
    };
    
    return a;
},
getTopLefOffset:function(){
    var a=tactile.c.E.getStyleValue(this.elem,"padding-top");
    var b=tactile.c.E.getStyleValue(this.elem,"padding-left");
    if(tactile.foundation.LayoutManager.loaded){
        this.getTopLefOffset=function(){
            return{
                top:a,
                left:b
            };
        
    };
    
    return this.getTopLefOffset();
}
return{
    top:a,
    left:b
};

},
resize:function(a){
    if(a){
        if(a.top!==undefined&&!isNaN(a.top)){
            this.elem.style.top=a.top+tactile.Enum.Unit.px;
        }else{
            this.elem.style.top="";
        }
        if(a.left!==undefined&&!isNaN(a.left)){
            this.elem.style.left=a.left+tactile.Enum.Unit.px;
        }else{
            this.elem.style.left="";
        }
        if(a.width!==undefined&&!isNaN(a.width)){
            this.elem.style.width=a.width+tactile.Enum.Unit.px;
        }else{
            this.elem.style.width="";
        }
        if(a.height!==undefined&&!isNaN(a.height)){
            this.elem.style.height=a.height+tactile.Enum.Unit.px;
        }else{
            this.elem.style.height="";
        }
        tactile.logger.info("resize: "+this.id+" "+JSON.stringify(a));
    }
},
update:function(f){
    var g=this.getBoxOffset();
    if(f){
        if(!this.effect||(this.effect&&this.state&&(this.state=="initialized"||this.state=="showed"||this.state=="hidden"))){
            if(this.effect&&(this.effect instanceof tactile.effects.Slide)&&(this.effect.useTransform||this.effect.useTransform3d)){
                var c=tactile.Device.browser.style;
                this.elem.style[c.transitionProperty]="";
                this.elem.style[c.transformProperty]="";
                this.elem.style[c.transitionDuration]="";
                this.elem.style[c.transitionTimingFunction]="";
                this.elem.style.left="";
                this.elem.style.top="";
                this.effect.posX=0;
                this.effect.posY=0;
            }
            if(f.top!==undefined&&!isNaN(f.top)){
                var d=this.validateNumber(this.configTop,f);
                if(d!==null){
                    this.elem.style.top=(d+g.top)+tactile.Enum.Unit.px;
                }
            }
            if(f.left!==undefined&&!isNaN(f.left)){
            var b=this.validateNumber(this.configLeft,f);
            if(b!==null){
                this.elem.style.left=(b+g.left)+tactile.Enum.Unit.px;
            }
        }
        if(f.width!==undefined&&!isNaN(f.width)){
        var a=this.validateNumber(this.configWidth,f);
        if(a!==null){
            this.elem.style.width=(a-g.width)+tactile.Enum.Unit.px;
            if(this.innerDiv){
                this.innerDiv.style.width=(a-g.width)+tactile.Enum.Unit.px;
            }
        }else{
        if(this.innerDiv){
            this.innerDiv.style.width="100%";
        }
    }
}
if(f.height!==undefined&&!isNaN(f.height)){
    var e=this.validateNumber(this.configHeight,f);
    if(e!==null){
        this.elem.style.height=(e-g.height)+tactile.Enum.Unit.px;
        if(this.innerDiv){
            this.innerDiv.style.height=(e-g.height)+tactile.Enum.Unit.px;
        }
    }else{
    if(this.innerDiv){
        this.innerDiv.style.height="100%";
    }
}
}
}
tactile.logger.info("update: "+this.id+" "+JSON.stringify(f));
}
if(this.configVisible!==undefined){
    if(this.validateVisible()){
        this.elem.style.display=this.elem.displayStyle;
    }else{
        this.elem.style.display=tactile.Enum.Display.none;
    }
}
},
append:function(a){
    if(a instanceof tactile.foundation.UIContainer){
        a.parent=this;
        tactile.foundation.UIComponent.prototype.append.call(this,a);
        if((a instanceof tactile.View)&&a.scrollConfig!=undefined&&!a.scrollerInitialized){
            a.scroller=new tactile.foundation.Scroller(a,a.scrollConfig);
            a.scrollerInitialized=true;
            tactile.logger.info(a.toString()+", scroller: "+a.scroller.toString());
        }
        a.update(a.getParentInnerBox());
        tactile.logger.info("tactile.foundation.UIContainer.append "+this.id+", element: "+a.id);
    }else{
        tactile.logger.error(this.id+"Type mismatch: tactile.foundation.UIContainer.append  expects argument of type tactile.foundation.UIContainer!");
    }
},
prepend:function(a){
    if(a instanceof tactile.foundation.UIContainer){
        a.parent=this;
        tactile.foundation.UIComponent.prototype.prepend.call(this,a);
        if((a instanceof tactile.View)&&a.scrollConfig!=undefined&&!a.scrollerInitialized){
            a.scroller=new tactile.foundation.Scroller(a,a.scrollConfig);
            a.scrollerInitialized=true;
            tactile.logger.info(a.toString()+", scroller: "+a.scroller.toString());
        }
        a.update(a.getParentInnerBox());
        tactile.logger.info("tactile.foundation.UIContainer.prerend "+this.id+", element: "+a.id);
    }else{
        tactile.logger.error(this.id+"Type mismatch: tactile.foundation.UIContainer.prepend  expects argument of type tactile.foundation.UIContainer!");
    }
},
clone:function(e,b){
    var a={},h;
    a.contentCopy=b||true;
    var c=e.elem.cloneNode(true);
    c.id=tactile.foundation.UIComponent.getNewId();
    function k(p){
        var q,n=p.childNodes;
        for(var o=0,l=n.length;o<l;o++){
            q=n[o];
            if("string"==typeof q.id){
                if(q.id!=""){
                    q.id=tactile.foundation.UIComponent.getNewId();
                }
            }
            if(q.childNodes&&q.childNodes.length){
            k(q);
        }
        }
    }
var d=c.getElementsByTagName("script");
for(var f=0;f<d.length;f++){
    c.removeChild(d[f]);
}
var i={};

if(typeof e.configHeight!="undefined"){
    i.height=e.configHeight();
}
if(typeof e.configWidth!="undefined"){
    i.width=e.configWidth();
}
if(typeof e.configTop!="undefined"){
    i.top=e.configTop();
}
if(typeof e.configLeft!="undefined"){
    i.left=e.configLeft();
}
if(typeof e.configVisible!="undefined"){
    i.visible=e.configVisible();
}
if(e.effect){
    var g="";
    if(e.effect instanceof tactile.effects.Fade){
        g=tactile.Enum.Effects.fade;
    }else{
        if(e.effect instanceof tactile.effects.Expand){
            g=tactile.Enum.Effects.expand;
        }else{
            if(e.effect instanceof tactile.effects.Slide){
                g=tactile.Enum.Effects.slide;
            }
        }
    }
i.effect={
    type:g,
    method:e.effect.getMethod(),
    duration:e.effect.duration,
    fps:e.effect.fps,
    timing:e.effect.timing
    };

}
if(e instanceof tactile.Layout){
    h=new tactile.Layout(c,i);
}else{
    if(e instanceof tactile.View){
        h=new tactile.View(c,i);
    }else{
        if(e instanceof tactile.MultiView){
            h=new tactile.MultiView(c,i);
        }else{
            if(e instanceof tactile.FlexView){
                h=new tactile.FlexView(c,i);
            }else{
                if(e instanceof tactile.FlexItem){
                    h=new tactile.FlexItem(c,i);
                }else{
                    if(e instanceof tactile.GridView){
                        h=new tactile.GridView(c,i);
                    }else{
                        if(e instanceof tactile.GridItem){
                            h=new tactile.GridItem(c,i);
                        }else{
                            throw tactile.errors.TypeError("tactile.foundation.UIContainer.prototype.clone","tactile.Layout, tactile.View, tactile.FlexView, tactile.FlexItem or tactile.MultiView",typeof e);
                        }
                    }
                }
        }
}
}
}
if(a.contentCopy){
    k(h.elem);
}else{
    while(h.elem.hasChildNodes()){
        c.removeChild(h.elem.firstChild);
    }
}
return h;
},
toString:function(){
    return"Object - tactile.foundation.UIContainer";
}
});
tactile.foundation.LayoutManager={
    layouts:new Array(),
    loaded:false,
    disabled:false,
    heightOffset:68,
    init:function(){
        var a=tactile.foundation.LayoutManager;
        if(!isNaN(tactile.Device.browser.adressbarheight)){
            a.heightOffset=tactile.Device.browser.adressbarheight;
        }
        if(a.layouts.length>0){
            if(tactile.Device.isTouch){
                var b=tactile.Device.screen.getHeight()+a.heightOffset;
                tactile.c.U.setBodyStyle("height",b+tactile.Enum.Unit.px);
            }
            tactile.EventManager.addOnloadListener(function(){
                a.loaded=true;
                a.updateLayout();
                window.setTimeout(function(){
                    a.updateLayout();
                },1000);
            });
            tactile.EventManager.addResizeListener(a.updateLayout,this);
            tactile.events.TouchEventManager.addListener(document,"touchmove",function(c){
                c.browserEvent.preventDefault();
                c.browserEvent.stopPropagation();
            });
            a.updateLayout();
            if(!tactile.pageLayout){
                if(tactile.Device.platform=="android"){
                    window.setTimeout(function(){
                        document.addEventListener("scroll",function(){
                            setTimeout(function(){
                                tactile.foundation.LayoutManager.updateLayout();
                            },500);
                        },2000);
                    });
                }
            }
        }
},
updateLayout:function(){
    var b=tactile.foundation.LayoutManager;
    if(b.disabled){
        return false;
    }
    if(!tactile.pageLayout){
        if(tactile.Device.isTouch){
            var c=tactile.Device.screen.getHeight()+b.heightOffset;
            tactile.c.U.setBodyStyle("height",c+tactile.Enum.Unit.px);
        }
        if(!isNaN(tactile.Device.browser.adressbarheight)&&tactile.Device.browser.adressbarheight>0){
            window.scrollTo(0,1);
        }else{
            if(isNaN(tactile.Device.browser.adressbarheight)){
                window.scrollTo(0,1);
            }
        }
    }
for(var a=0;a<b.layouts.length;a++){
    b.layouts[a].update(b.layouts[a].getParentInnerBox());
}
tactile.c.U.updateRenderTreeFix();
},
addLayout:function(b){
    var a=tactile.foundation.LayoutManager;
    if(b instanceof tactile.Layout){
        if(!a.layouts.contains(b)){
            a.layouts.push(b);
        }
    }else{
    throw tactile.errors.TypeError("tactile.foundation.LayoutManager.addLayout","Layout",typeof b);
}
}
};

tactile.foundation.HistoryManager=(function(){
    var HistoryManager={
        currentState:"",
        isHashChange:false,
        isPushState:false,
        isHistoryApi:false,
        isUserAction:false,
        oldUrl:"",
        newUrl:"",
        storage:{},
        init:function(){
            this.isHashChange=("onhashchange" in window);
            this.isPushState=("pushState" in history);
            this.isHistoryApi=this.isHashChange&&this.isPushState;
            if(this.isPushState){
                window.addEventListener("popstate",this.onStateChanged.bind(this),false);
            }else{
                if(this.isHashChange){
                    window.addEventListener("hashchange",this.onHashStateChanged.bind(this),false);
                }else{
                    var self=this;
                    this.timer=setInterval(function(){
                        if(self.oldUrl!=window.location.href){
                            if(!self.isUserAction){
                                self.runActionFromHash();
                            }else{
                                self.isUserAction=false;
                            }
                            self.oldUrl=window.location.href;
                        }
                    },200);
            }
        }
    },
addHistoryState:function(stateObj,title,url){
    if(!stateObj||!stateObj.callback||!stateObj.name){
        return false;
    }
    if(this.currentState==stateObj.name){
        return false;
    }else{
        this.currentState=stateObj.name;
    }
    if(this.isPushState){
        window.history.pushState({
            callback:"var m = "+stateObj.callback.toString()
            },(title?title:""),(url?url:""));
    }else{
        this.isUserAction=true;
        this.oldUrl=window.location.href;
        if(!window.location.hash){
            window.location.hash=stateObj.name;
        }else{
            window.location.hash+=("&"+stateObj.name);
        }
        if(window.sessionStorage){
            window.sessionStorage[stateObj.name]="var m = "+stateObj.callback.toString();
        }else{
            this.storage[stateObj.name]=stateObj.callback;
        }
        this.newUrl=window.location.href;
    }
},
replaceHistoryState:function(stateObj,title,url){
    if(this.isPushState){
        if(window.history.replaceState){
            window.history.replaceState({
                callback:"var m = "+stateObj.callback.toString()
                },(title?title:""),(url?url:""));
        }
    }else{
    this.isUserAction=true;
    this.oldUrl=window.location.href;
    if(!window.location.hash||window.location.hash.indexOf("&")==-1){
        window.location.replace("#"+stateObj.name);
    }else{
        window.location.replace(window.location.hash.replace(/([^&]+)$/,stateObj.name));
    }
    if(window.sessionStorage){
        window.sessionStorage[stateObj.name]="var m = "+stateObj.callback.toString();
    }else{
        this.storage[stateObj.name]=stateObj.callback;
    }
    this.newUrl=window.location.href;
}
},
onStateChanged:function(e){
    if(e.state&&e.state.callback){
        eval(e.state.callback);
        m();
    }
},
onHashStateChanged:function(e){
    if(!this.isUserAction){
        this.runActionFromHash.call(this);
    }else{
        this.isUserAction=false;
    }
    return false;
},
runActionFromHash:function(){
    if(window.location.hash){
        var hash=window.location.hash.replace("#","");
        hash=hash.split("&"),hash=hash[hash.length-1];
        if(window.sessionStorage&&window.sessionStorage[hash]){
            eval(window.sessionStorage[hash]);
            m();
        }else{
            if(this.storage[hash]){
                this.storage[hash]();
            }
        }
    }
}
};

HistoryManager.init();
return HistoryManager;
})();
tactile.AjaxLoader=function(a){
    a=a||{};
    
    this.onstart=new tactile.foundation.Observer();
    this.onsuccess=new tactile.foundation.Observer();
    this.onerror=new tactile.foundation.Observer();
    this.timeout=60000;
    this.responseUID=((new Date()).getTime()+""+Math.floor(Math.random()*1000000)).substr(0,18);
    this.customErrors=a.errors||{};
    
    this.url=a.url;
    this.method=a.method||"get";
    this.parameters=a.params||"";
    this.isJSONP=a.isJSONP||false;
    this.xhr=null;
};

tactile.AjaxLoader.JsonpRegistrator={};
    
tactile.AjaxLoader.extend({
    getResponseText:function(){
        if(this.xhr!==null){
            return this.xhr.responseText;
        }else{
            return null;
        }
    },
getResponseXML:function(){
    if(this.xhr!==null){
        return this.xhr.responseXML;
    }else{
        return null;
    }
},
load:function(b){
    var c=undefined;
    this.url=b.url||this.url;
    this.method=b.method||this.method;
    this.onstart.fire({
        status:0,
        message:"",
        url:this.url,
        loader:this
    });
    this.parameters=b.params||this.parameters;
    this.isJSONP=b.isJSONP||this.isJSONP;
    if(this.isJSONP){
        this.createJsonp();
        return false;
    }
    this.xhr=new tactile.c.A.getXHRObject();
    this.xhr.onreadystatechange=(function(){
        try{
            if(this.xhr.readyState==4){
                clearTimeout(c);
                if(this.xhr.status==200){
                    var f=this.getStatus();
                    this.onsuccess.fire({
                        status:f.status,
                        message:f.message,
                        url:this.url,
                        loader:this
                    });
                }else{
                    var f=this.getStatus();
                    this.onerror.fire({
                        status:f.status,
                        message:f.message,
                        url:this.url,
                        loader:this
                    });
                }
            }
        }catch(g){
        this.onerror.fire({
            status:g.number,
            message:g.message,
            url:this.url,
            loader:this
        });
    }
}).bind(this);
try{
    this.xhr.open(this.method,this.url,true);
    var a=this;
    c=setTimeout(function(){
        a.xhr.abort();
        a.onerror.fire({
            status:"408",
            message:"Request Time-out",
            url:a.url,
            loader:a
        });
    },a.timeout);
}catch(d){
    this.onerror.fire({
        status:d.number,
        message:d.message,
        url:this.url,
        loader:this
    });
}
this.xhr.setRequestHeader("Cache-Control","no-transform");
this.xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
if(this.method.toUpperCase()=="GET"){
    this.xhr.send(null);
}else{
    this.xhr.send(this.parameters);
}
},
createJsonp:function(){
    try{
        this.onstart.fire({
            status:"jsonp",
            message:"request started",
            url:this.url,
            loader:this
        });
        var a=document.createElement("script"),b=null,d=(new Date()).getTime();
        a.onload=function(){
            this.onsuccess.fire({
                status:"success",
                message:"request time: "+(d-(new Date()).getTime()),
                url:this.url,
                response:b
            });
        }.bind(this);
        a.onerror=(function(){
            this.onerror.fire({
                message:arguments[0],
                url:this.url,
                loader:this
            });
        }).bind(this);
        tactile.AjaxLoader.JsonpRegistrator.AjaxLoader=function(){
            b=arguments;
        };
        
        a.type="text/javascript";
        a.src=this.url+"?"+(this.parameters!=""?this.parameters+"&":"")+"callback=tactile.AjaxLoader.JsonpRegistrator.AjaxLoader";
        document.getElementsByTagName("head")[0].appendChild(a);
    }catch(c){
        this.onerror.fire({
            status:c.number,
            message:c.message,
            url:this.url,
            loader:this
        });
    }
},
stop:function(){
    if(this.xhr!==null){
        this.xhr.abort();
        this.onerror.fire({
            status:"0",
            message:"Request stopped",
            url:this.url,
            loader:this
        });
    }
},
getStatus:function(){
    return(this.customErrors[this.xhr.status])?{
        status:this.xhr.status,
        message:this.customErrors[this.xhr.status]
        }:{
        status:this.xhr.status,
        message:this.xhr.statusText
        };
    
},
setCustomErrors:function(a){
    this.customErrors=a;
}
});
tactile.ContentLoader=function(a){
    a=a||{};
    
    this.onstart=new tactile.foundation.Observer();
    this.onsuccess=new tactile.foundation.Observer();
    this.onerror=new tactile.foundation.Observer();
    this.timeout=60000;
    this.responseUID=tactile.c.U.getUID();
    var b="";
    this.setUrl=function(c){
        if(c){
            if(c.indexOf("http")==0){
                throw new tactile.errors.InvalidArgument("tactile.ContentLoader","config.url");
            }else{
                b=c;
            }
        }
        return b;
};

this.scriptInitialized=false;
this.loadedComponents=[];
this.customErrors=a.errors||{};

this.url=this.setUrl(a.url);
    this.method=a.method||"get";
    this.parameters=a.params||"";
    this.fragmentId=a.fragment;
    this.xhr=null;
};

tactile.ContentLoader.prototype=new tactile.AjaxLoader();
tactile.ContentLoader.extend({
    removeResponseContainer:function(){
        var a=document.getElementById(this.responseUID);
        if(a){
            a.parentNode.removeChild(a);
        }
    },
load:function(b){
    var d=undefined,f;
    b=b||{};
    
    this.xhr=tactile.c.A.getXHRObject();
    this.url=this.setUrl(b.url);
    this.method=b.method||this.method;
    this.onstart.fire({
        status:0,
        message:"",
        url:this.url,
        loader:this
    });
    this.parameters=b.params||this.parameters;
    if(b.fragment){
        this.fragmentId=b.fragment;
    }
    if(this.fragmentId){
        if(this.parameters.length>0){
            this.parameters+="&";
        }
        this.parameters+="nbbiscuitid="+this.fragmentId;
    }
    this.parameters=(this.parameters.length>0)?(this.parameters+"&"):this.parameters;
    if(tactile.Device.browser.canCookie){
        this.parameters+="emvcc=1";
    }else{
        this.parameters+="emvcc=0";
    }
    this.parameters+="&disablejsd=true";
    if(this.url.indexOf("?")>=0){
        var c=this.url.split("?");
        if(c.length>0){
            this.url=c[0]+tactile.c.A.getSessionID()+"?";
            if(c[1]){
                this.url=this.url+c[1];
            }
        }
        this.url=this.url+"&";
}else{
    this.url=this.url+tactile.c.A.getSessionID()+"?";
}
if(this.method.toUpperCase()=="GET"){
    if(this.url.indexOf("?")>=0){
        this.url=this.url+"&";
    }else{
        if(this.parameters.length>0){
            this.url=this.url+"?";
        }
    }
    this.url+=this.parameters;
}
var a=this;
this.xhr.onreadystatechange=function(){
    try{
        if(a.xhr.readyState==4){
            clearTimeout(d);
            if(a.xhr.status==200){
                a.scriptInitialized=false;
                a.loadedComponents=[];
                var h=a.getStatus();
                a.onsuccess.fire({
                    status:h.status,
                    message:h.message,
                    url:a.url,
                    loader:a
                });
            }else{
                var h=a.getStatus();
                a.onerror.fire({
                    status:h.status,
                    message:h.message,
                    url:a.url,
                    loader:a
                });
            }
        }
    }catch(i){
    a.onerror.fire({
        status:i.number,
        message:i.message,
        url:a.url,
        loader:a
    });
}
};

try{
    f=tactile.c.A.getRootPath()+this.url;
    this.xhr.open(this.method,f,true);
    d=setTimeout(function(){
        a.xhr.abort();
        a.onerror.fire({
            status:"408",
            message:"Request Time-out",
            url:a.url,
            loader:a
        });
    },a.timeout);
}catch(g){
    a.onerror.fire({
        status:g.number,
        message:g.message,
        url:a.url,
        loader:a
    });
}
this.xhr.setRequestHeader("Cache-Control","no-transform");
this.xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
if(this.method.toUpperCase()=="GET"){
    this.xhr.send(null);
}else{
    this.xhr.send(this.parameters);
}
},
getComponent:function(d){
    var b=null;
    var a=this.getComponents();
    for(var c=0;c<a.length;c++){
        if(a[c].id==d){
            b=a[c];
        }
    }
    return b;
},
evaluate:function(args){
    var responseDom=args.shift();
    var filter=[];
    if(args&&args.length>0){
        for(var j=0;j<args.length;j++){
            filter.push(args[j].toString());
        }
        }else{
    filter=[tactile.View.toString(),tactile.MultiView.toString(),tactile.FlexView.toString(),tactile.Layout.toString(),tactile.FlexItem.toString(),tactile.GridView.toString(),tactile.GridItem.toString()];
}
var responseContainer,scripts;
this.removeResponseContainer();
responseContainer=document.createElement("div");
responseContainer.setAttribute("id",this.responseUID);
responseContainer.style.display="none";
responseContainer.appendChild(responseDom);
document.body.appendChild(responseContainer);
tactile.c.U.fixLinks();
if(responseContainer){
    scripts=responseContainer.getElementsByTagName("script");
    for(var i=0;i<scripts.length;i++){
        var script=scripts[i].innerHTML;
        var found=false;
        filter.forEach(function(el){
            if(script.indexOf(el)>-1){
                found=true;
            }
        });
    if(found){
        var compid=scripts[i].parentNode.id;
        if(compid.indexOf("nbautoid")>-1&&tactile.page.isComponent(compid)){
            compid=tactile.foundation.UIComponent.getNewId();
            script=script.replace(scripts[i].parentNode.id,compid);
            scripts[i].parentNode.id=compid;
        }
        if(!tactile.page.isComponent(scripts[i].parentNode.id)){
            try{
                script=script.replace(/\n/gim,"");
                script=script.replace(/<!--/gim,"");
                script=script.replace(/-->/gim,"");
                script=script.replace(/tactile.\page\.init\s*?\(function\s*?\(\)\s*?\{(.*?)\}\);$/gim,"$1");
                var newcomp=eval(script);
                this.loadedComponents.push(newcomp);
            }catch(ex){
                tactile.logger.error("ContentLoader.getComponents: initialization of remote component "+scripts[i].parentNode.id+" has thrown an exception: "+ex.message);
            }
        }else{
        tactile.logger.warn("ContentLoader.getComponents: component "+scripts[i].parentNode.id+" allready exists!");
    }
    }
}
}
},
getComponents:function(){
    var a=Array.prototype.slice.call(arguments);
    if(!this.scriptInitialized&&this.xhr!==null){
        a.unshift(this.xhr.getResponseDom());
        this.evaluate(a);
        this.scriptInitialized=true;
    }
    return this.loadedComponents;
}
});
tactile.Layout=function(f,b){
    b=b||{};
    
    if(b.position&&tactile.Enum.contains(tactile.Enum.Position,b.position)){
        b.position=tactile.Enum.getValue(tactile.Enum.Position,b.position);
    }else{
        b.position=tactile.Enum.Position.absolute;
    }
    if(b.overflow&&tactile.Enum.contains(tactile.Enum.Overflow,b.overflow)){
        b.overflow=tactile.Enum.getValue(tactile.Enum.Overflow,b.overflow);
    }else{
        b.overflow=tactile.Enum.Overflow.hidden;
    }
    var e=(typeof f=="string")?f:f.id;
    if(b.parent){
        this.parent=b.parent;
    }else{
        tactile.foundation.LayoutManager.addLayout(this);
    }
    if(b.template){
        if(b.height){
            var g=b.height;
            b.height=function(h){
                if(this.validateVisible()){
                    if(typeof g==="function"){
                        return Math.round(g.call(this,h));
                    }
                    return Math.round(g);
                }
                return 0;
            };
        
    }
    if(b.width){
        var d=b.width;
        b.width=function(h){
            if(this.validateVisible()){
                if(typeof d==="function"){
                    return Math.round(d.call(this,h));
                }
                return Math.round(d);
            }
            return 0;
        };
    
}
if(b.top){
    var a=b.top;
    b.top=function(h){
        if(this.validateVisible()){
            if(typeof a==="function"){
                return Math.round(a.call(this,h));
            }
            return Math.round(a);
        }
        return 0;
    };

}
if(b.left){
    var c=b.left;
    b.left=function(h){
        if(this.validateVisible()){
            if(typeof c==="function"){
                return Math.round(c.call(this,h));
            }
            return Math.round(c);
        }
        return 0;
    };

}
if(b.template==="top"||b.template==="bottom"){
    b.height=b.height||function(h){
        if(this.validateVisible()){
            return Math.round(h.height*0.15);
        }
        return 0;
    };
    
    b.width=b.width||function(h){
        if(this.validateVisible()){
            return h.width;
        }
        return 0;
    };
    
    if(b.template==="top"){
        tactile.c.E.addClass(document.getElementById(e),this.parent.id+"_North");
        b.top=b.top||function(h){
            return 0;
        };
    
}
if(b.template==="bottom"){
    tactile.c.E.addClass(document.getElementById(e),this.parent.id+"_South");
    b.top=b.top||function(k){
        if(this.validateVisible()){
            var i=0;
            var l=document.getElementsByClassName(this.parent.id+"_North");
            var h=document.getElementsByClassName(this.parent.id+"_Center");
            i=l[0]?i+tactile.page.getComponent(l[0].id).configHeight(k):i;
            i=h[0]?i+tactile.page.getComponent(h[0].id).configHeight(k):i;
            return i;
        }
        return 0;
    };

}
}
if(b.template==="center"){
    tactile.c.E.addClass(document.getElementById(e),this.parent.id+"_Center");
    b.width=b.width||function(l){
        if(this.validateVisible()){
            var k=l.width;
            var i=document.getElementsByClassName(this.parent.id+"_East");
            var h=document.getElementsByClassName(this.parent.id+"_West");
            k=i[0]?k-tactile.page.getComponent(i[0].id).configWidth(l):k;
            k=h[0]?k-tactile.page.getComponent(h[0].id).configWidth(l):k;
            return k;
        }
        return 0;
    };
    
    b.height=b.height||function(k){
        if(this.validateVisible()){
            var h=k.height;
            var l=document.getElementsByClassName(this.parent.id+"_North");
            var i=document.getElementsByClassName(this.parent.id+"_South");
            h=l[0]?h-tactile.page.getComponent(l[0].id).configHeight(k):h;
            h=i[0]?h-tactile.page.getComponent(i[0].id).configHeight(k):h;
            return h;
        }
        return 0;
    };
    
    b.top=b.top||function(h){
        var i=document.getElementsByClassName(this.parent.id+"_North");
        if(i){
            if(this.validateVisible()){
                return tactile.page.getComponent(i[0].id).configHeight(h);
            }
        }
        return 0;
};

b.left=b.left||function(i){
    if(this.validateVisible()){
        var h=document.getElementsByClassName(this.parent.id+"_West");
        var k=h[0]?tactile.page.getComponent(h[0].id).configWidth(i):0;
        return k;
    }
    return 0;
};

}
if(b.template==="left"){
    tactile.c.E.addClass(document.getElementById(e),this.parent.id+"_West");
    b.width=b.width||function(h){
        if(this.validateVisible()){
            return Math.round(h.width*0.15);
        }
        return 0;
    };
    
    b.top=b.top||function(h){
        var i=document.getElementsByClassName(this.parent.id+"_North");
        if(i){
            if(this.validateVisible()){
                return tactile.page.getComponent(i[0].id).configHeight(h);
            }
        }
        return 0;
};

b.height=b.height||function(k){
    if(this.validateVisible()){
        var h=k.height;
        var l=document.getElementsByClassName(this.parent.id+"_North");
        var i=document.getElementsByClassName(this.parent.id+"_South");
        h=l[0]?h-tactile.page.getComponent(l[0].id).configHeight(k):h;
        h=i[0]?h-tactile.page.getComponent(i[0].id).configHeight(k):h;
        return h;
    }
    return 0;
};

}
if(b.template==="right"){
    tactile.c.E.addClass(document.getElementById(e),this.parent.id+"_East");
    b.width=b.width||function(h){
        if(this.validateVisible()){
            return Math.round(h.width*0.15);
        }
        return 0;
    };
    
    b.top=b.top||function(h){
        var i=document.getElementsByClassName(this.parent.id+"_North");
        if(i){
            if(this.validateVisible()){
                return tactile.page.getComponent(i[0].id).configHeight(h);
            }
        }
        return 0;
};

b.height=b.height||function(k){
    if(this.validateVisible()){
        var h=k.height;
        var l=document.getElementsByClassName(this.parent.id+"_North");
        var i=document.getElementsByClassName(this.parent.id+"_South");
        h=l[0]?h-tactile.page.getComponent(l[0].id).configHeight(k):h;
        h=i[0]?h-tactile.page.getComponent(i[0].id).configHeight(k):h;
        return h;
    }
    return 0;
};

b.left=b.left||function(k){
    if(this.validateVisible()){
        var i=document.getElementsByClassName(this.parent.id+"_West");
        var h=document.getElementsByClassName(this.parent.id+"_Center");
        var l=i[0]?tactile.page.getComponent(i[0].id).configWidth(k):0;
        l=h[0]?l+tactile.page.getComponent(h[0].id).configWidth(k):l;
        return l;
    }
    return 0;
};

}
}
if(!b.width){
    throw new tactile.errors.ArgumentUndefined("tactile.Layout","config.width");
}
if(!b.height){
    throw new tactile.errors.ArgumentUndefined("tactile.Layout","config.height");
}
tactile.Layout.prototype.init.call(this,f,b);
this.onresize=new tactile.foundation.Observer();
this.onstatechange=new tactile.foundation.Observer();
this.aftershow=new tactile.foundation.Observer();
this.beforeshow=new tactile.foundation.Observer();
this.afterhide=new tactile.foundation.Observer();
this.beforehide=new tactile.foundation.Observer();
this.domchanged=new tactile.foundation.Observer();
if(b.parent&&b.parent.getBox){
    b.parent.onresize.subscribe(this.update,this);
}
this.aftershow.subscribe(function(h){
    this.update(this.getParentInnerBox());
},this);
this.state="initialized";
this.beforehide.subscribe(function(h){
    this.state="hiding";
},this);
this.afterhide.subscribe(function(h){
    this.state="hidden";
},this);
this.afterhide.subscribe(function(h){
    this.onstatechange.fire({
        sourceId:h.targetId
        });
},this);
this.beforeshow.subscribe(function(h){
    this.state="showing";
},this);
this.aftershow.subscribe(function(h){
    this.state="showed";
},this);
this.aftershow.subscribe(function(h){
    this.onstatechange.fire({
        sourceId:h.targetId
        });
},this);
if(tactile.Device.platform==="ios"&&tactile.Device.version>=5){
    this.aftershow.subscribe(function(h){
        tactile.c.U.updateRenderTreeFix(this.elem);
    },this);
}
};

tactile.Layout.cast=function(a){
    return(a instanceof tactile.Layout)?a:null;
};

tactile.Layout.prototype=new tactile.foundation.UIContainer();
tactile.Layout.extend({
    update:function(b){
        tactile.foundation.UIContainer.prototype.update.call(this,b);
        var a=this.getInnerBox();
        this.onresize.fire(a);
    },
    updateState:function(a){
        this.onstatechange.fire(a);
    },
    append:function(a){
        if(a instanceof tactile.Layout||a instanceof tactile.View||a instanceof tactile.MultiView||a instanceof tactile.FlexView||component instanceof tactile.GridView){
            if(a.parent){
                a.parent.onresize.unsubscribe(a.update);
            }
            tactile.foundation.UIContainer.prototype.append.call(this,a);
            a.parent.onresize.subscribe(a.update,a);
            this.domchanged.fire({});
        }else{
            throw new tactile.errors.TypeError("tactile.Layout.append","tactile.View, tactile.FlexView or tactile.MultiView",typeof a);
        }
    },
prepend:function(a){
    if(a instanceof tactile.Layout||a instanceof tactile.View||a instanceof tactile.MultiView||a instanceof tactile.FlexView||component instanceof tactile.GridView){
        if(a.parent){
            a.parent.onresize.unsubscribe(a.update);
        }
        tactile.foundation.UIContainer.prototype.prepend.call(this,a);
        a.parent.onresize.subscribe(a.update,a);
        this.domchanged.fire({});
    }else{
        throw new tactile.errors.TypeError("tactile.Layout.prepend","tactile.View, tactile.FlexView or tactile.MultiView",typeof a);
    }
},
remove:function(a){
    if(a instanceof tactile.Layout||a instanceof tactile.View||a instanceof tactile.MultiView||a instanceof tactile.FlexView||a instanceof tactile.GridView){
        tactile.foundation.UIComponent.prototype.remove.call(this,a);
        this.domchanged.fire({});
    }else{
        throw new tactile.errors.TypeError("tactile.Layout.remove","tactile.View, tactile.FlexView or tactile.MultiView",typeof a);
    }
},
clone:function(a){
    return tactile.foundation.UIContainer.prototype.clone(this,a);
},
toString:function(){
    return"Object - tactile.Layout";
}
});
tactile.Layout.toString=function(){
    return"tactile.Layout";
};

tactile.View=function(b,a){
    a=a||{};
    
    if(a.parent){
        if(a.parent instanceof tactile.foundation.UIContainer===true){
            this.parent=a.parent;
        }else{
            tactile.logger.error("Error - type mismatch: View "+this.id+" expects parent of type UIContainer!");
        }
    }
    if(a.effect){
    if(a.effect.type==tactile.Enum.Effects.expand||a.effect.type==tactile.Enum.Effects.slide){
        if(!a.position){
            a.position=tactile.Enum.Position.absolute;
        }
        if(a.effect.type==tactile.Enum.Effects.expand){
            if(!a.overflow){
                a.overflow=tactile.Enum.Overflow.hidden;
            }
        }
        if(!a.width&&this.parent){
        a.width=this.parent.configWidth;
    }
}
}
tactile.View.prototype.init.call(this,b,a);
this.onresize=new tactile.foundation.Observer();
this.onstatechange=new tactile.foundation.Observer();
this.aftershow=new tactile.foundation.Observer();
this.beforeshow=new tactile.foundation.Observer();
this.afterhide=new tactile.foundation.Observer();
this.beforehide=new tactile.foundation.Observer();
if(this.parent&&this.parent instanceof tactile.MultiView===true){
    if(!this.parent.views.contains(this)){
        this.parent.addView(this);
    }
}
if(this.parent&&this.parent.getBox){
    this.parent.onresize.subscribe(this.update,this);
}
this.scroller=undefined;
this.scrollConfig=undefined;
this.scrollerInitialized=false;
if(a.scroll){
    var c={
        scroll:a.scroll
        };
        
    if(a.scrollbar){
        c.scrollbar=a.scrollbar;
    }
    if(typeof a.bounce==="boolean"){
        c.bounce=a.bounce;
    }
    if(this.parent){
        this.scroller=new tactile.foundation.Scroller(this,c);
        this.scrollerInitialized=true;
        tactile.logger.info(this.toString()+", scroller: "+this.scroller.toString());
    }else{
        this.scrollConfig=c;
    }
}
this.aftershow.subscribe(function(d){
    this.update(this.getParentInnerBox());
},this);
this.state="initialized";
this.beforehide.subscribe(function(d){
    this.state="hiding";
},this);
this.afterhide.subscribe(function(d){
    this.state="hidden";
},this);
this.afterhide.subscribe(function(d){
    this.onstatechange.fire({
        sourceId:d.targetId
        });
},this);
this.beforeshow.subscribe(function(d){
    this.state="showing";
},this);
this.aftershow.subscribe(function(d){
    this.state="showed";
},this);
this.aftershow.subscribe(function(d){
    this.onstatechange.fire({
        sourceId:d.targetId
        });
},this);
if(tactile.Device.platform==="ios"&&tactile.Device.version>=5){
    this.aftershow.subscribe(function(d){
        tactile.c.U.updateRenderTreeFix(this.elem);
    },this);
}
tactile.EventManager.addListener(this.id,"click",function(g){
    var f=null,d=g.target;
    do{
        if(d.href){
            if(d.hash){
                f=unescape(d.hash);
            }else{
                href=unescape(d.href);
            }
            break;
        }
        d=d.parentNode;
    }while(d);
    if(f){
        g.browserEvent.preventDefault();
        try{
            tactile.c.U.attrValidator.validate(f,true);
        }catch(g){
            tactile.logger.log(g);
        }
        return false;
    }
});
};

tactile.View.prototype=new tactile.foundation.UIContainer();
tactile.View.cast=function(a){
    return(a instanceof tactile.View)?a:null;
};

tactile.View.extend({
    update:function(b){
        tactile.foundation.UIContainer.prototype.update.call(this,b);
        var a=this.getInnerBox();
        this.onresize.fire(a);
    },
    updateState:function(a){
        if((this.state==="hiding"||this.state==="showing")&&this.effect&&this.effect.transitionEnd){
            this.effect.transitionEnd({});
        }
        this.onstatechange.fire(a);
    },
    append:function(a){
        if(a instanceof tactile.View||a instanceof tactile.MultiView||a instanceof tactile.FlexView||a instanceof tactile.GridView){
            if(a.parent){
                a.parent.onresize.unsubscribe(a.update);
            }
            tactile.foundation.UIContainer.prototype.append.call(this,a);
            a.parent.onresize.subscribe(a.update,a);
        }else{
            throw new tactile.errors.TypeError("tactile.View.append","tactile.View, tactile.FlexView or tactile.MultiView",typeof a);
        }
    },
prepend:function(a){
    if(a instanceof tactile.View||a instanceof tactile.MultiView||a instanceof tactile.FlexView||a instanceof tactile.GridView){
        if(a.parent){
            a.parent.onresize.unsubscribe(a.update);
        }
        tactile.foundation.UIContainer.prototype.prepend.call(this,a);
        a.parent.onresize.subscribe(a.update,a);
    }else{
        throw new tactile.errors.TypeError("tactile.View.prepend","tactile.View, tactile.FlexView or tactile.MultiView",typeof a);
    }
},
clone:function(a){
    return tactile.foundation.UIContainer.prototype.clone(this,a);
},
show:function(a){
    if(this.scroller&&this.scroller.scrollbar){
        this.scroller.scrollbar.hBar.style.display="block";
        this.scroller.scrollbar.vBar.style.display="block";
    }
    if(this.parent&&this.parent instanceof tactile.MultiView&&this.show.caller!=tactile.MultiView.prototype.showView){
        this.parent.showView(this.id,a);
    }else{
        tactile.foundation.UIComponent.prototype.show.call(this,a);
    }
},
hide:function(a){
    if(this.scroller&&this.scroller.scrollbar){
        this.scroller.scrollbar.hBar.style.display="none";
        this.scroller.scrollbar.vBar.style.display="none";
    }
    if(this.parent&&this.parent instanceof tactile.MultiView&&this.hide.caller!=tactile.MultiView.prototype.showView){
        if(this.parent.views[this.parent.selectedIndex]==this){
            this.parent.showNext(a);
        }
    }else{
    tactile.foundation.UIComponent.prototype.hide.call(this,a);
}
},
setContent:function(b){
    var a=this;
    if(a instanceof tactile.View){
        if(a.getChildren().length===0){
            if(typeof b!=="string"){
                throw tactile.errors.InvalidArgument("tactile.View.prototype.setContent",b);
            }
            a.elem.getElementsByTagName("div")[0].innerHTML=b;
        }
    }else{
    throw tactile.errors.TypeError("tactile.View.prototype.setContent","tactile.View",typeof a);
}
},
addContent:function(a){
    if(typeof a!=="string"){
        throw tactile.errors.InvalidArgument("tactile.View.prototype.addContent",a);
    }
    this.setContent(this.elem.getElementsByTagName("div")[0].innerHTML+a);
},
toString:function(){
    return"Object - tactile.View";
}
});
tactile.View.toString=function(){
    return"tactile.View";
};

tactile.MultiView=function(d,b){
    b=b||{};
    
    b.width=b.width||function(e){
        return e.width;
    };
    
    b.height=b.height||function(e){
        return e.height;
    };
    
    if(b.parent){
        this.parent=b.parent;
    }
    tactile.MultiView.prototype.init.call(this,d,b);
    this.onresize=new tactile.foundation.Observer();
    this.onstatechange=new tactile.foundation.Observer();
    this.aftershow=new tactile.foundation.Observer();
    this.beforeshow=new tactile.foundation.Observer();
    this.afterhide=new tactile.foundation.Observer();
    this.beforehide=new tactile.foundation.Observer();
    this.onswitch=new tactile.foundation.Observer();
    if(this.parent&&this.parent.getBox){
        this.parent.onresize.subscribe(this.update,this);
    }
    this.views=new Array();
    this.selectedIndex=0;
    this.prevIndex=0;
    if(b.selectedIndex&&!isNaN(b.selectedIndex)){
        this.selectedIndex=b.selectedIndex;
    }
    var a=this;
    if(b.swipe){
        this.swipe=b.swipe;
        this.elem.me=a;
        tactile.events.TouchEventManager.addListener(this.elem,"swipe",a.onSwipe);
    }
    this.aftershow.subscribe(function(f){
        this.update(this.getParentInnerBox());
    },this);
    this.state="initialized";
    this.showing=false;
    this.hiding=false;
    this.beforehide.subscribe(function(f){
        this.hiding=true;
        this.state="hiding";
    },this);
    this.afterhide.subscribe(function(f){
        this.hiding=false;
        this.state="hidden";
    },this);
    this.afterhide.subscribe(function(f){
        this.onstatechange.fire({
            sourceId:f.targetId
            });
    },this);
    this.beforeshow.subscribe(function(f){
        this.showing=true;
        this.state="showing";
    },this);
    this.aftershow.subscribe(function(f){
        this.showing=false;
        this.state="showed";
    },this);
    this.aftershow.subscribe(function(f){
        this.onstatechange.fire({
            sourceId:f.targetId
            });
    },this);
    var c=0;
    this.setSwitching=function(e){
        if(e){
            c+=2;
        }else{
            c-=1;
        }
    };
    
this.isSwitching=function(){
    return(this.showing||this.hiding);
};

};

tactile.MultiView.cast=function(a){
    return(a instanceof tactile.MultiView)?a:null;
};

tactile.MultiView.prototype=new tactile.foundation.UIContainer();
tactile.MultiView.extend({
    addView:function(a,c){
        if(a instanceof tactile.View){
            if(!this.views.contains(a)){
                if(this.selectedIndex!=this.views.length){
                    a.elem.style.display=tactile.Enum.Display.none;
                }
                a.afterhide.subscribe(function(){
                    this.setSwitching(false);
                },this);
                a.aftershow.subscribe(function(){
                    this.setSwitching(false);
                },this);
                if(!a.parent){
                    a.parent=this;
                }
                a.getVisibility=undefined;
                var b=this;
                a.afterhide.subscribe(function(d){
                    b.afterhide.fire({
                        index:b.prevIndex
                        });
                });
                a.aftershow.subscribe(function(d){
                    b.aftershow.fire({
                        index:b.selectedIndex
                        });
                });
                if(!c){
                    this.views.push(a);
                }else{
                    this.views.unshift(a);
                }
            }
            return a;
    }else{
        throw new tactile.errors.TypeError("tactile.MultiView.addView","type tactile.View",typeof a);
    }
},
addViewById:function(b,a){
    a=a||{};
    
    a.parent=a.parent||this;
    return this.addView(new tactile.View(b,a));
},
addViewsByClassName:function(d,b){
    b=b||{};
    
    b.parent=b.parent||this;
    var a=tactile.c.E.getElementsByClassName(this.elem,d);
    for(var c=0;c<a.length;c++){
        this.addView(new tactile.View(a[c],b));
    }
    },
getViews:function(){
    return this.views;
},
getViewByIndex:function(a){
    if(a<this.views.length&&a>=0&&this.views[a]){
        return this.views[a];
    }
    return null;
},
append:function(a){
    if(a instanceof tactile.View){
        if(a.parent){
            a.parent.onresize.unsubscribe(a.update);
        }
        tactile.foundation.UIContainer.prototype.append.call(this,a);
        a.parent.onresize.subscribe(a.update,a);
        this.addView(a);
    }else{
        throw new tactile.errors.TypeError("tactile.MultiView.appendView","tactile.View",typeof a);
    }
},
prepend:function(a){
    if(a instanceof tactile.View){
        if(a.parent){
            a.parent.onresize.unsubscribe(a.update);
        }
        tactile.foundation.UIContainer.prototype.prepend.call(this,a);
        a.parent.onresize.subscribe(a.update,a);
        this.addView(a,true);
    }else{
        throw new tactile.errors.TypeError("tactile.MultiView.appendView","tactile.View",typeof a);
    }
},
remove:function(b){
    if(b instanceof tactile.View){
        if(this.views.contains(b)&&this.views.length>1){
            var a=this.views.indexOf(b,0);
            if(a!=-1){
                if(this.selectedIndex==a){
                    var c=this;
                    this.showNext();
                    if(b.effect){
                        duration=b.effect.duration;
                    }
                    if(b.effect){
                        b.afterhide.subscribe(function(d){
                            tactile.foundation.UIComponent.prototype.remove.call(c,b);
                            c.views.splice(a,1);
                            if(c.selectedIndex>0){
                                c.selectedIndex-=1;
                            }
                        },this);
                }else{
                    tactile.foundation.UIComponent.prototype.remove.call(c,b);
                    c.views.splice(a,1);
                    if(c.selectedIndex>0){
                        c.selectedIndex-=1;
                    }
                }
            }else{
        tactile.foundation.UIComponent.prototype.remove.call(this,b);
        this.views.splice(a,1);
        if(this.selectedIndex>a){
            this.selectedIndex-=1;
        }
    }
}
}
}
},
inverseConfig:function(b){
    var a={};
    
    if(typeof b==="object"&&b.slideto&&b.slidefrom){
        a.slideto=b.slidefrom;
        a.slidefrom=b.slideto;
    }
    return a;
},
showView:function(d,c){
    if(d<0||d>=this.views.length){
        tactile.logger.error(this.id+".showView("+d+", "+c+"): Index out of bounds (0 - "+this.views.length+")");
        return;
    }
    if(this.isSwitching()){
        return;
    }
    var g=null;
    if(!isNaN(d)){
        if(d!=this.selectedIndex){
            if(d>=this.views.length){
                return;
            }
            g=this.selectedIndex;
            this.prevIndex=g;
            this.selectedIndex=d;
            this.setSwitching(true);
            this.beforehide.fire({
                index:g
            });
            this.views[g].hide(c);
            if(!this.views[g].effect){
                this.afterhide.fire({
                    index:g
                });
            }
            var b=this;
            this.beforeshow.fire({
                index:d
            });
            this.views[this.selectedIndex].show(c);
            if(!this.views[this.selectedIndex].effect){
                this.aftershow.fire({
                    index:b.selectedIndex
                    });
            }
        }
    }else{
    var a=null;
    for(var f=0;f<this.views.length;f++){
        if(this.views[f].id===d){
            a=f;
            break;
        }
    }
    if(a!==null&&a!=this.selectedIndex){
    g=this.selectedIndex;
    this.prevIndex=g;
    this.selectedIndex=a;
    this.setSwitching(true);
    var b=this;
    this.beforehide.fire({
        index:g
    });
    this.views[g].hide(c);
    if(!this.views[g].effect){
        this.afterhide.fire({
            index:g
        });
    }
    this.beforeshow.fire({
        index:d
    });
    this.views[this.selectedIndex].show(c);
    if(!this.views[this.selectedIndex].effect){
        this.aftershow.fire({
            index:b.selectedIndex
            });
    }
}
}
if(g!==null){
    var h={
        target:this.id,
        previousIndex:g,
        selectedIndex:this.selectedIndex,
        previousId:this.views[g].id,
        selectedId:this.views[this.selectedIndex].id
        };
        
    this.onswitch.fire(h);
    var e=this.getInnerBox();
    this.onresize.fire(e);
}
},
showNext:function(a){
    if(this.selectedIndex+1>=this.views.length){
        this.showFirst(a);
    }else{
        this.showView(this.selectedIndex+1,a);
    }
},
showPrev:function(a){
    if(this.selectedIndex-1<0){
        this.showLast(a);
    }else{
        this.showView(this.selectedIndex-1,a);
    }
},
showFirst:function(a){
    this.showView(0,a);
},
showLast:function(a){
    this.showView(this.views.length-1,a);
},
update:function(b){
    if(this.selectedIndex<0||isNaN(this.selectedIndex)){
        this.selectedIndex=0;
    }else{
        if(this.selectedIndex>this.views.length-1){
            this.selectedIndex=(this.views.length>0)?this.views.length-1:0;
        }
    }
    tactile.foundation.UIContainer.prototype.update.call(this,b);
var a=this.getInnerBox();
this.onresize.fire(a);
},
updateState:function(a){
    this.onstatechange.fire(a);
},
onSwipe:function(d){
    var a=this.me;
    var c=d.direction.toUpperCase();
    var b=a.validateSwipeDirection();
    if(c=="LEFT"){
        a.showNext({
            slideto:tactile.Enum.Direction.west,
            slidefrom:tactile.Enum.Direction.east
            });
    }else{
        if(c=="RIGHT"){
            a.showPrev({
                slideto:tactile.Enum.Direction.east,
                slidefrom:tactile.Enum.Direction.west
                });
        }
    }
},
validateSwipeDirection:function(){
    var b=tactile.effects.Direction.horizontal;
    if(this.swipe){
        if(typeof this.swipe==="function"){
            try{
                b=this.swipe();
            }catch(a){
                b=tactile.effects.Direction.horizontal;
                tactile.logger.error(this.id+".validateSwipeDirection() has thrown an exception: "+a);
            }
        }else{
        if(typeof this.swipe==="string"){
            if(tactile.Enum.contains(tactile.effects.Direction,this.swipe)){
                b=this.swipe;
            }else{
                b=tactile.effects.Direction.horizontal;
                tactile.logger.error(this.id+".validateSwipeDirection - tactile.effects.Direction doesn't contains "+this.swipe);
            }
        }
    }
}
return b;
},
clone:function(){
    return tactile.foundation.UIContainer.prototype.clone(this,false);
},
toString:function(){
    return"Object - tactile.MultiView";
}
});
tactile.MultiView.toString=function(){
    return"tactile.MultiView";
};

tactile.FlexView=function(b,a){
    a=a||{};
    
    if(a.parent){
        if(a.parent instanceof tactile.foundation.UIContainer===true){
            this.parent=a.parent;
        }else{
            tactile.logger.error("Error - type mismatch: tactile.Flexview "+this.id+" expects parent of type UIContainer!");
        }
    }
    tactile.FlexView.prototype.init.call(this,b,a);
    this.onresize=new tactile.foundation.Observer();
    this.onstatechange=new tactile.foundation.Observer();
    this.aftershow=new tactile.foundation.Observer();
    this.beforeshow=new tactile.foundation.Observer();
    this.afterhide=new tactile.foundation.Observer();
    this.beforehide=new tactile.foundation.Observer();
    if(this.parent){
    this.parent.onresize.subscribe(this.update,this);
}
this.flexitems=new Array();
    this.scroller=undefined;
    if(a.scroll){
    var c={
        scroll:a.scroll
        };
        
    if(a.scrollbar){
        c.scrollbar=a.scrollbar;
    }
    if(typeof a.bounce==="boolean"){
        c.bounce=a.bounce;
    }
    this.scroller=new tactile.foundation.Scroller(this,c);
}
a.flexitem=a.flexitem||{};

this.configFlexFlow=undefined;
this.configFlexDimension=undefined;
this.configFlexItemGap=undefined;
this.configFlexItemWidth=undefined;
this.configFlexItemHeight=undefined;
this.configFlexItemMinWidth=undefined;
this.configFlexItemMinHeight=undefined;
if(a.flexflow){
    if(typeof a.flexflow==="function"){
        this.configFlexFlow=a.flexflow;
    }else{
        if(tactile.Enum.contains(tactile.Enum.FlexFlow,a.flexflow)){
            this.configFlexFlow=function(){
                return a.flexflow;
            };
        
    }else{
        this.configFlexFlow=function(){
            return tactile.Enum.FlexFlow.vertical;
        };
    
}
}
}else{
    this.configFlexFlow=function(){
        return tactile.Enum.FlexFlow.vertical;
    };

}
if(a.flexdimension){
    if(typeof a.flexdimension==="function"){
        this.configFlexDimension=a.flexdimension;
    }else{
        if(tactile.Enum.contains(tactile.Enum.Dimension,a.flexdimension)){
            this.configFlexDimension=function(){
                return a.flexdimension;
            };
        
    }
}
}
if(a.flexitem.gap){
    if(typeof a.flexitem.gap==="function"){
        this.configFlexItemGap=a.flexitem.gap;
    }else{
        if(!isNaN(a.flexitem.gap)){
            this.configFlexItemGap=function(d){
                return a.flexitem.gap;
            };
        
    }
}
}else{
    this.configFlexItemGap=function(d){
        return 0;
    };

}
if(a.flexitem.width){
    if(typeof a.flexitem.width==="function"){
        this.configFlexItemWidth=a.flexitem.width;
    }else{
        if(!isNaN(a.flexitem.width)){
            this.configFlexItemWidth=function(d){
                return a.flexitem.width;
            };
        
    }
}
}
if(a.flexitem.height){
    if(typeof a.flexitem.height==="function"){
        this.configFlexItemHeight=a.flexitem.height;
    }else{
        if(!isNaN(a.flexitem.height)){
            this.configFlexItemHeight=function(d){
                return a.flexitem.height;
            };
        
    }
}
}
if(a.flexitem.minwidth){
    if(typeof a.flexitem.minwidth==="function"){
        this.configFlexItemMinWidth=a.flexitem.minwidth;
    }else{
        if(!isNaN(a.flexitem.minwidth)){
            this.configFlexItemMinWidth=function(d){
                return a.flexitem.minwidth;
            };
        
    }
}
}
if(a.flexitem.minheight){
    if(typeof a.flexitem.minheight==="function"){
        this.configFlexItemMinHeight=a.flexitem.minheight;
    }else{
        if(!isNaN(a.flexitem.minheight)){
            this.configFlexItemMinHeight=function(d){
                return a.flexitem.minheight;
            };
        
    }
}
}
this.aftershow.subscribe(function(d){
    this.update(this.getParentInnerBox());
},this);
this.state="initialized";
this.beforehide.subscribe(function(d){
    this.state="hiding";
},this);
this.afterhide.subscribe(function(d){
    this.state="hidden";
},this);
this.afterhide.subscribe(function(d){
    this.onstatechange.fire({
        sourceId:d.targetId
        });
},this);
this.beforeshow.subscribe(function(d){
    this.state="showing";
},this);
this.aftershow.subscribe(function(d){
    this.state="showed";
},this);
this.aftershow.subscribe(function(d){
    this.onstatechange.fire({
        sourceId:d.targetId
        });
},this);
};

tactile.FlexView.cast=function(a){
    return(a instanceof tactile.FlexView)?a:null;
};

tactile.FlexView.prototype=new tactile.foundation.UIContainer();
tactile.FlexView.extend({
    addItem:function(b,a){
        if(b instanceof tactile.FlexItem){
            if(!this.flexitems.contains(b)){
                if(!a){
                    this.flexitems.push(b);
                }else{
                    this.flexitems.unshift(b);
                }
            }
            return b;
    }else{
        throw new tactile.errors.TypeError("tactile.FlexView.addItem","tactile.FlexItem",typeof b);
    }
},
addItemById:function(b,a){
    a=a||{};
    
    a.parent=a.parent||this;
    return this.addItem(new tactile.FlexItem(b,a));
},
addItemsByClassName:function(d,b){
    b=b||{};
    
    b.parent=b.parent||this;
    var a=tactile.c.E.getElementsByClassName(this.elem,d);
    for(var c=0;c<a.length;c++){
        this.addItem(new tactile.FlexItem(a[c],b));
    }
    },
append:function(a){
    if(a instanceof tactile.FlexItem){
        tactile.foundation.UIContainer.prototype.append.call(this,a);
        this.addItem(a);
        this.update(this.getParentInnerBox());
    }else{
        throw new tactile.errors.TypeError("Error - type mismatch: tactile.FlexView.appendView expects argument of type tactile.FlexItem!");
    }
},
prepend:function(a){
    if(a instanceof tactile.FlexItem){
        tactile.foundation.UIContainer.prototype.prepend.call(this,a);
        this.addItem(a,true);
        this.update(this.getParentInnerBox());
    }else{
        throw new tactile.errors.TypeError("tactile.FlexView.prependView","tactile.FlexItem",typeof a);
    }
},
getItems:function(){
    return this.flexitems;
},
getItemByIndex:function(a){
    if(a<this.flexitems.length&&a>=0&&this.flexitems[a]){
        return this.flexitems[a];
    }
    return null;
},
remove:function(b){
    if(b instanceof tactile.FlexItem){
        tactile.foundation.UIComponent.prototype.remove.call(this,b);
        if(this.flexitems.contains(b)){
            var a=this.flexitems.indexOf(b,0);
            if(a!=-1){
                this.flexitems.splice(a,1);
            }
            this.update(this.getParentInnerBox());
        }
    }
},
update:function(g){
    tactile.foundation.UIContainer.prototype.update.call(this,g);
    var p=this.flexitems;
    var n=this.configFlexItemGap(this.getBox());
    var r=n;
    var f=n;
    var c=undefined;
    var e=undefined;
    var a=undefined;
    var s=undefined;
    var l=undefined;
    var q=undefined;
    var u=this.validateNumber(this.configHeight,this.getBox());
    var k=this.validateNumber(this.configWidth,this.getBox());
    if(this.configWidth!=undefined&&k!=null){
        l=k;
    }else{
        l=this.parent.getOuterBox().width-n-n;
    }
    if(this.configHeight!=undefined&&u!=null){
        q=u;
    }else{
        q=this.parent.getOuterBox().height-n-n;
    }
    if(this.configFlexItemWidth!=undefined){
        a=this.validateNumber(this.configFlexItemWidth,this.getBox());
        if(a>=l){
            a=a-n-n;
        }
    }else{
    a=l;
}
if(this.configFlexItemHeight!=undefined){
    s=this.validateNumber(this.configFlexItemHeight,this.getBox());
    if(s>=q){
        s=s-n-n;
    }
}else{
    s=q-n-n;
}
if(this.configFlexItemMinWidth!=undefined){
    c=this.validateNumber(this.configFlexItemMinWidth,this.getBox());
}
if(this.configFlexItemMinHeight!=undefined){
    e=this.validateNumber(this.configFlexItemMinHeight,this.getBox());
}
if(s!=undefined&&e!=undefined&&s<=e){
    s=e;
}
if(a!=undefined&&c!=undefined&&a<=c){
    a=c;
}
for(var t=0;t<p.length;t++){
    p[t].resize({});
    if(this.validFlexFlow()==tactile.Enum.FlexFlow.vertical){
        if(this.configFlexItemHeight===undefined){
            if((e!==undefined)&&(e>=p[t].getOuterBox().height)){
                s=e;
            }else{
                s=p[t].getOuterBox().height;
            }
        }
    }else{
    if(this.configFlexItemWidth===undefined){
        if((c!==undefined)&&(c>=p[t].getInnerBox().width)){
            a=c;
        }else{
            a=p[t].getOuterBox().width;
        }
    }
}
p[t].resize({
    width:a,
    height:s,
    left:f,
    top:r
});
p[t].onresize.fire(p[t].getInnerBox());
if(this.configFlexFlow()==tactile.Enum.FlexFlow.vertical){
    r+=p[t].getOuterBox().height+n;
}else{
    f+=p[t].getOuterBox().width+n;
}
}
var o;
var d=this.getBoxOffset();
var v=this.validateNumber(this.configHeight,g);
var b=this.validateNumber(this.configWidth,g);
if(this.validFlexFlow()==tactile.Enum.FlexFlow.vertical){
    o={
        width:((this.configWidth!=undefined&&b!=null)?(b-d.width):g.width),
        height:r,
        left:((this.configLeft!=undefined)?(this.configLeft(g)-d.left):undefined),
        top:((this.configTop!=undefined)?(this.configTop(g)-d.width):undefined)
        };
    
}else{
    o={
        width:f,
        height:((this.configHeight!=undefined&&v!=null)?(v-d.height):g.height),
        left:((this.configLeft!=undefined)?(this.configLeft(g)-d.left):undefined),
        top:((this.configTop!=undefined)?(this.configTop(g)-d.width):undefined)
        };
    
}
this.resize(o);
var x=this.getInnerBox();
this.onresize.fire(x);
},
validFlexFlow:function(){
    var a=tactile.Enum.FlexFlow.vertical;
    if(this.configFlexFlow){
        try{
            a=this.configFlexFlow();
        }catch(b){
            tactile.logger.error(this.id+".validFlexFlow() has thrown an exception: "+b);
            a=tactile.Enum.FlexFlow.vertical;
        }
        if(tactile.Enum.contains(tactile.Enum.FlexFlow,a)){
            return a;
        }else{
            tactile.logger.error(this.id+".validFlexFlow - tactile.Enum.FlexFlow doesn't contains "+a);
            a=tactile.Enum.FlexFlow.vertical;
        }
    }
    return a;
},
validFlexDimension:function(){
    var a=undefined;
    if(this.configFlexDimension){
        try{
            a=this.configFlexDimension();
        }catch(b){
            tactile.logger.error(this.id+".validFlexDimension() has thrown an exception: "+b);
            a=undefined;
        }
        if(tactile.Enum.contains(tactile.Enum.Dimension,a)){
            return a;
        }else{
            tactile.logger.error(this.id+".validFlexDimension - tactile.Enum.Dimension doesn't contains "+a);
            a=undefined;
        }
    }
    return a;
},
clone:function(){
    return tactile.foundation.UIContainer.prototype.clone(this,false);
},
toString:function(){
    return"Object - tactile.FlexView";
}
});
tactile.FlexView.toString=function(){
    return"tactile.FlexView";
};

tactile.FlexItem=function(b,a){
    a=a||{};
    
    if(a.position&&tactile.Enum.contains(tactile.Enum.Position,a.position)){
        a.position=tactile.Enum.getValue(tactile.Enum.Position,a.position);
    }else{
        a.position=tactile.Enum.Position.absolute;
    }
    if(a.parent){
        if(a.parent instanceof tactile.FlexView===true){
            this.parent=a.parent;
            if(!this.parent.flexitems.contains(this)){
                this.parent.addItem(this);
            }
        }else{
        tactile.logger.error("Error - type mismatch: FlexItem "+this.id+" expects parent of type FlexView!");
    }
}
tactile.FlexItem.prototype.init.call(this,b,a);
this.onresize=new tactile.foundation.Observer();
this.onstatechange=new tactile.foundation.Observer();
this.aftershow=new tactile.foundation.Observer();
this.beforeshow=new tactile.foundation.Observer();
this.afterhide=new tactile.foundation.Observer();
this.beforehide=new tactile.foundation.Observer();
this.aftershow.subscribe(function(c){
    this.update(this.getParentInnerBox());
},this);
this.state="initialized";
this.beforehide.subscribe(function(c){
    this.state="hiding";
},this);
this.afterhide.subscribe(function(c){
    this.state="hidden";
},this);
this.afterhide.subscribe(function(c){
    this.onstatechange.fire({
        sourceId:c.targetId
        });
},this);
this.beforeshow.subscribe(function(c){
    this.state="showing";
},this);
this.aftershow.subscribe(function(c){
    this.state="showed";
},this);
this.aftershow.subscribe(function(c){
    this.onstatechange.fire({
        sourceId:c.targetId
        });
},this);
tactile.EventManager.addListener(this.id,"click",function(f){
    var d=null,c=f.target;
    do{
        if(c.href){
            if(c.hash){
                d=unescape(c.hash);
            }else{
                href=unescape(c.href);
            }
            break;
        }
        c=c.parentNode;
    }while(c);
    if(d){
        f.browserEvent.preventDefault();
        try{
            tactile.c.U.attrValidator.validate(d,true);
        }catch(f){
            tactile.logger.log(f);
        }
        return false;
    }
});
};

tactile.FlexItem.prototype=new tactile.foundation.UIContainer();
tactile.FlexItem.extend({
    update:function(b){
        tactile.foundation.UIContainer.prototype.update.call(this,b);
        var a=this.getInnerBox();
        this.onresize.fire(a);
    },
    clone:function(a){
        return tactile.foundation.UIContainer.prototype.clone(this,a);
    },
    setContent:function(b){
        var a=this;
        if(a instanceof tactile.FlexView){
            if(a.getChildren().length===0){
                if(typeof b!=="string"){
                    throw tactile.errors.InvalidArgument("tactile.FlexItem.prototype.setContent",b);
                }
                a.elem.getElementsByTagName("div")[0].innerHTML=b;
            }
        }else{
        throw tactile.errors.TypeError("tactile.FlexItem.prototype.setContent","tactile.FlexItem",typeof a);
    }
},
addContent:function(a){
    if(typeof a!=="string"){
        throw tactile.errors.InvalidArgument("tactile.FlexItem.prototype.addContent",a);
    }
    this.setContent(this.elem.getElementsByTagName("div")[0].innerHTML+a);
},
toString:function(){
    return"Object - tactile.FlexItem";
}
});
tactile.FlexItem.cast=function(a){
    return(a instanceof tactile.FlexItem)?a:null;
};

tactile.FlexItem.toString=function(){
    return"tactile.FlexItem";
};

tactile.GridView=function(b,a){
    a=a||{};
    
    tactile.GridView.prototype.init.call(this,b,a);
    this.onresize=new tactile.foundation.Observer();
    this.aftershow=new tactile.foundation.Observer();
    this.beforeshow=new tactile.foundation.Observer();
    this.afterhide=new tactile.foundation.Observer();
    this.beforehide=new tactile.foundation.Observer();
    if(a.parent){
        this.parent=a.parent;
    }
    if(a.parent){
        a.parent.onresize.subscribe(this.update,this);
    }
    this.griditems=new Array();
    this.scroller=undefined;
    if(a.scroll){
        var c={
            scroll:a.scroll
            };
            
        if(a.scrollbar){
            c.scrollbar=a.scrollbar;
        }
        if(typeof a.bounce==="boolean"){
            c.bounce=a.bounce;
        }
        this.scroller=new tactile.foundation.Scroller(this,c);
    }
    if(a.gridflow){
        if(typeof a.gridflow==="function"){
            this.configGridFlow=a.gridflow;
        }else{
            if(tactile.Enum.contains(tactile.Enum.GridFlow,a.gridflow)){
                this.configGridFlow=function(){
                    return a.gridflow;
                };
            
        }else{
            this.configGridFlow=function(){
                return tactile.Enum.GridFlow.vertical;
            };
        
    }
}
}else{
    this.configGridFlow=function(){
        return tactile.Enum.GridFlow.vertical;
    };

}
this.containerAlign=a.align||"left";
if(a.griditem){
    this.gridItemConfig={};
    
    if(a.griditem.vgap){
        if(typeof a.griditem.vgap==="function"){
            this.gridItemConfig.vgap=a.griditem.vgap;
        }else{
            if(!isNaN(a.griditem.vgap)){
                this.gridItemConfig.vgap=function(d){
                    return a.griditem.vgap;
                };
            
        }
    }
}else{
    this.gridItemConfig.vgap=function(d){
        return 0;
    };

}
if(a.griditem.hgap){
    if(typeof a.griditem.hgap==="function"){
        this.gridItemConfig.hgap=a.griditem.hgap;
    }else{
        if(!isNaN(a.griditem.hgap)){
            this.gridItemConfig.hgap=function(d){
                return a.griditem.hgap;
            };
        
    }
}
}else{
    this.gridItemConfig.hgap=function(d){
        return 0;
    };

}
if(this.configGridFlow()===tactile.Enum.GridFlow.horizontal&&!a.griditem.itemswidth){
    this.configGridFlow=function(){
        return tactile.Enum.GridFlow.vertical;
    };
    
    tactile.logger.warn(this.id+".validGridFlow - vertical GridFlow can`t be seted without gridItem width");
}else{
    this.gridItemConfig.width=a.griditem.itemswidth;
}
if(this.configGridFlow()===tactile.Enum.GridFlow.vertical&&!a.griditem.itemsheight){
    this.configGridFlow=function(){
        return tactile.Enum.GridFlow.horizontal;
    };
    
    tactile.logger.warn(this.id+".validGridFlow - horizontal GridFlow can`t be seted without gridItem height");
}else{
    this.gridItemConfig.height=a.griditem.itemsheight;
}
if(!a.griditem.itemsheight&&!a.griditem.itemswidth){
    throw new tactile.errors.InvalidArgument("tactile.GridView","config.griditem");
}
}else{
    throw new tactile.errors.InvalidArgument("tactile.GridView","config.griditem");
}
this.aftershow.subscribe(function(d){
    this.update(this.getParentInnerBox());
},this);
};

tactile.GridView.prototype=new tactile.foundation.UIContainer;
tactile.GridView.cast=function(a){
    return(a instanceof tactile.GridView)?a:null;
};

tactile.GridView.extend({
    setAlign:function(a){
        if(~"left|right|center".indexOf(a)){
            this.containerAlign=a;
            this.update(this.getParentInnerBox());
        }
    },
addItem:function(b,a){
    if(b instanceof tactile.GridItem){
        if(!this.griditems.contains(b)){
            if(!a){
                this.griditems.push(b);
            }else{
                this.griditems.unshift(b);
            }
        }
        return b;
}else{
    throw new tactile.errors.TypeError("tactile.GridView.addItem","tactile.GridItem",typeof b);
}
},
append:function(a){
    if(a instanceof tactile.GridItem){
        tactile.foundation.UIContainer.prototype.append.call(this,a);
        this.addItem(a);
        this.update(this.getParentInnerBox());
    }else{
        throw new tactile.errors.TypeError("tactile.GridView.append","tactile.GridItem",typeof a);
    }
},
prepend:function(a){
    if(a instanceof tactile.GridItem){
        tactile.foundation.UIContainer.prototype.prepend.call(this,a);
        this.addItem(a,true);
        this.update(this.getParentInnerBox());
    }else{
        throw new tactile.errors.TypeError("tactile.GridView.prepend","tactile.GridItem",typeof a);
    }
},
getItems:function(){
    return this.griditems;
},
getItemByIndex:function(a){
    if(a<this.griditems.length&&a>=0&&this.griditems[a]){
        return this.griditems[a];
    }
    return null;
},
remove:function(b){
    if(b instanceof tactile.GridItem){
        tactile.foundation.UIComponent.prototype.remove.call(this,b);
        if(this.griditems.contains(b)){
            var a=this.griditems.indexOf(b,0);
            if(a!=-1){
                this.griditems.splice(a,1);
            }
            this.update(this.getParentInnerBox());
        }
    }
},
update:function(e){
    tactile.foundation.UIContainer.prototype.update.call(this,e);
    var p,k,g=this.gridItemConfig.hgap(this.getBox()),q=this.gridItemConfig.vgap(this.getBox());
    if(this.gridItemConfig.width!=undefined){
        p=this.validateNumber(this.gridItemConfig.width,this.getBox());
    }
    if(this.gridItemConfig.height!=undefined){
        k=this.validateNumber(this.gridItemConfig.height,this.getBox());
    }
    var o={
        hgap:g,
        vgap:q,
        itemPerLine:0,
        row:0,
        cell:0,
        leftpos:g,
        toppos:q,
        biggestHeight:k||0,
        biggestWidth:p||0,
        flow:true,
        increaseSize:function(h){
            if(this.flow){
                this.biggestHeight=h.getInnerBox().height>this.biggestHeight?h.getInnerBox().height:this.biggestHeight;
            }else{
                this.biggestWidth=h.getInnerBox().width>this.biggestWidth?h.getInnerBox().width:this.biggestWidth;
            }
        },
    getGridSizes:function(t,s,u,v){
        t=t||{};
        
        var r=s.validateNumber(s.configHeight,s.getBox());
        var i=s.validateNumber(s.configWidth,s.getBox());
        if(this.flow){
            t.gridViewWidth=(s.configWidth!=undefined&&i!=null)?i:(u+this.hgap)*this.itemPerLine+this.hgap,t.gridViewHeight=(s.configHeight!=undefined&&r!=null)?r:this.toppos+this.biggestHeight+this.vgap;
        }else{
            t.gridViewWidth=(s.configWidth!=undefined&&i!=null)?i:this.leftpos+this.biggestWidth+this.hgap,t.gridViewHeight=(s.configHeight!=undefined&&r!=null)?r:(v+this.vgap)*this.itemPerLine+this.vgap;
        }
        return t;
    }
};

var f=this.validateNumber(this.configHeight,this.getBox());
var l=this.validateNumber(this.configWidth,this.getBox());
if(this.validGridFlow()==tactile.Enum.GridFlow.horizontal){
    o.itemPerLine=Math.floor((((this.configWidth!=undefined&&l!=null)?l:this.parent.getInnerBox().width)-o.hgap)/(p+o.hgap));
}else{
    o.itemPerLine=Math.floor((((this.configHeight!=undefined&&f!=null)?f:this.parent.getInnerBox().height)-o.vgap)/(k+o.vgap));
    o.flow=false;
}
for(var c=0,b=this.griditems.length;c<b;c++){
    this.getActualCoordinate(o);
    this.griditems[c].resize({
        width:p,
        height:k,
        left:o.leftpos,
        top:o.toppos
        });
    o.increaseSize(this.griditems[c]);
}
var d={};

o.getGridSizes(d,this,p,k);
for(var c=0,b=this.griditems.length;c<b;c++){
    this.griditems[c].resize({
        width:this.griditems[c].getInnerBox().width,
        height:this.griditems[c].getInnerBox().height,
        left:this.griditems[c].getBox().left,
        top:this.griditems[c].getBox().top
        });
    this.griditems[c].onresize.fire(this.griditems[c].getInnerBox());
}
var n={
    width:d.gridViewWidth,
    height:d.gridViewHeight,
    left:this.containerAlign=="center"?(this.parent.getBox().width/2-d.gridViewWidth/2):(this.containerAlign=="right"?(this.parent.getBox().width-d.gridViewWidth):(((this.configLeft!=undefined)?this.validateNumber(this.configLeft,this.getBox()):0))),
    top:((this.configTop!=undefined)?this.validateNumber(this.configTop,this.getBox()):0)
    };
    
this.resize(n);
var a=this.getInnerBox();
this.onresize.fire(a);
},
getActualCoordinate:function(a){
    a.leftpos=a.flow?(a.biggestWidth+a.hgap)*a.cell+a.hgap:a.leftpos;
    a.toppos=!a.flow?(a.biggestHeight+a.vgap)*a.cell+a.vgap:a.toppos;
    if(a.cell>0&&(a.cell%a.itemPerLine==0)){
        a.leftpos=a.flow?a.hgap:a.leftpos+a.biggestWidth+a.hgap;
        a.toppos=a.flow?a.toppos+a.biggestHeight+a.vgap:a.vgap;
        if(a.flow){
            a.biggestHeight=0;
        }else{
            a.biggestWidth=0;
        }
        a.row+=1;
        a.cell=1;
    }else{
        a.cell+=1;
    }
},
validGridFlow:function(){
    var a=tactile.Enum.GridFlow.vertical;
    if(this.configGridFlow){
        try{
            a=this.configGridFlow();
        }catch(b){
            tactile.logger.error(this.id+".validGridFlow() has thrown an exception: "+b);
            a=tactile.Enum.GridFlow.vertical;
        }
        if(tactile.Enum.contains(tactile.Enum.GridFlow,a)){
            if(a===tactile.Enum.GridFlow.horizontal&&!this.gridItemConfig.width){
                a=tactile.Enum.GridFlow.vertical;
                tactile.logger.warn(this.id+".validGridFlow - horizontal GridFlow can`t be seted without gridItem width");
            }else{
                if(a===tactile.Enum.GridFlow.vertical&&!this.gridItemConfig.height){
                    a=tactile.Enum.GridFlow.horizontal;
                    tactile.logger.warn(this.id+".validGridFlow - vertical GridFlow can`t be seted without gridItem height");
                }
            }
            return a;
    }else{
        tactile.logger.error(this.id+".validGridFlow - tactile.Enum.GridFlow doesn't contains "+a);
        a=tactile.Enum.GridFlow.horizontal;
    }
}
return a;
},
toString:function(){
    return"Object - tactile.GridView";
}
});
tactile.GridView.toString=function(){
    return"tactile.GridView";
};

tactile.GridItem=function(b,a){
    a=a||{};
    
    if(a.position&&tactile.Enum.contains(tactile.Enum.Position,a.position)){
        a.position=tactile.Enum.getValue(tactile.Enum.Position,a.position);
    }else{
        a.position=tactile.Enum.Position.absolute;
    }
    if(a.parent){
        if(a.parent instanceof tactile.GridView===true){
            this.parent=a.parent;
            if(!this.parent.griditems.contains(this)){
                this.parent.addItem(this);
            }
        }else{
        tactile.logger.error("Error - type mismatch: GridItem "+this.id+" expects parent of type GridView!");
    }
}
tactile.GridItem.prototype.init.call(this,b,a);
this.onresize=new tactile.foundation.Observer();
this.onstatechange=new tactile.foundation.Observer();
this.aftershow=new tactile.foundation.Observer();
this.beforeshow=new tactile.foundation.Observer();
this.afterhide=new tactile.foundation.Observer();
this.beforehide=new tactile.foundation.Observer();
this.aftershow.subscribe(function(c){
    this.update(this.getParentInnerBox());
},this);
this.state="initialized";
this.beforehide.subscribe(function(c){
    this.state="hiding";
},this);
this.afterhide.subscribe(function(c){
    this.state="hidden";
},this);
this.afterhide.subscribe(function(c){
    this.onstatechange.fire({
        sourceId:c.targetId
        });
},this);
this.beforeshow.subscribe(function(c){
    this.state="showing";
},this);
this.aftershow.subscribe(function(c){
    this.state="showed";
},this);
this.aftershow.subscribe(function(c){
    this.onstatechange.fire({
        sourceId:c.targetId
        });
},this);
tactile.EventManager.addListener(this.id,"click",function(f){
    var d=null,c=f.target;
    do{
        if(c.href){
            if(c.hash){
                d=unescape(c.hash);
            }else{
                href=unescape(c.href);
            }
            break;
        }
        c=c.parentNode;
    }while(c);
    if(d){
        f.browserEvent.preventDefault();
        try{
            tactile.c.U.attrValidator.validate(d,true);
        }catch(f){
            tactile.logger.log(f);
        }
        return false;
    }
});
};

tactile.GridItem.prototype=new tactile.foundation.UIContainer();
tactile.GridItem.extend({
    update:function(b){
        tactile.foundation.UIContainer.prototype.update.call(this,b);
        var a=this.getInnerBox();
        this.onresize.fire(a);
    },
    clone:function(a){
        return tactile.foundation.UIContainer.prototype.clone(this,a);
    },
    setContent:function(b){
        var a=this;
        if(a instanceof tactile.GridItem){
            if(a.getChildren().length===0){
                if(typeof b!=="string"){
                    throw tactile.errors.InvalidArgument("tactile.GridItem.prototype.setContent",b);
                }
                a.elem.getElementsByTagName("div")[0].innerHTML=b;
            }
        }else{
        throw tactile.errors.TypeError("tactile.GridItem.prototype.setContent","tactile.GridItem",typeof a);
    }
},
addContent:function(a){
    if(typeof a!=="string"){
        throw tactile.errors.InvalidArgument("tactile.GridItem.prototype.addContent",a);
    }
    this.setContent(this.elem.getElementsByTagName("div")[0].innerHTML+a);
},
toString:function(){
    return"Object - tactile.GridItem";
}
});
tactile.GridItem.toString=function(){
    return"tactile.GridItem";
};

tactile.GridItem.cast=function(a){
    return(a instanceof tactile.GridItem)?a:null;
};

tactile.EventManager={
    addResizeListener:function(b,a){
        if(!b){
            throw new tactile.errors.ArgumentUndefined("tactile.EventManager.addResizeListener","fn");
        }
        tactile.c.V.addResizeListener(b,a);
    },
    addDomReadyListener:function(a){
        if(!a){
            throw new tactile.errors.ArgumentUndefined("tactile.EventManager.addDomReadyListene","fn");
        }
        tactile.c.V.domReady.add(a);
    },
    addOnloadListener:function(a){
        tactile.c.V.addListener(window,"load",a);
    },
    addUnloadListener:function(a){
        tactile.c.V.addListener(window,"unload",a);
    },
    addListener:function(b,d,a){
        if(!a){
            throw new tactile.errors.ArgumentUndefined("tactile.EventManager.addListener","fn");
        }
        var c=null;
        if(typeof b==="string"){
            c=document.getElementById(b);
        }else{
            if(tactile.c.E.isHTMLElement(b)){
                c=b;
            }else{
                if(b instanceof tactile.foundation.Element){
                    c=b.elem;
                }
            }
        }
    if(!c){
    tactile.logger.error("tactile.EventManager.addListener - No element found to add event "+d+" for element: "+b);
    return;
}
if(c.id===""){
    c.setAttribute("id",tactile.c.U.getUID());
}
if(tactile.events&&tactile.events.TouchEventManager.isTouchEvent(d)){
    tactile.events.TouchEventManager.addListener(c,d,a);
    return true;
}else{
    return tactile.c.V.addManagedListener(c,d,a);
}
},
addSecuredListener:function(d,c,b){
    var a=function(g){
        try{
            b.call(g);
        }catch(f){
            tactile.logger.error("tactile.EventManager.addSecuredListener - "+f);
        }
    };
    
tactile.EventManager.addListener(d,c,a);
},
removeListener:function(d,c,a){
    var b;
    if(!c&&!a){
        if(d in tactile.c.V.listeners){
            b=d;
            c=tactile.c.V.listeners[d].event;
            a=undefined;
        }
    }else{
    if(typeof d==="string"){
        b=document.getElementById(d);
    }else{
        if(d instanceof tactile.foundation.Element){
            b=d.elem;
        }
    }
}
if(!a&&!(d in tactile.c.V.listeners)){
    throw new tactile.errors.ArgumentUndefined("tactile.EventManager.removeListener","fn");
}
if(!b){
    tactile.logger.error("tactile.EventManager.removeListener - No element found to remove event "+c+" for id: "+d);
    return;
}
if(tactile.events&&tactile.events.TouchEventManager.isTouchEvent(c)>0){
    tactile.events.TouchEventManager.removeListener(b,c,a);
}else{
    tactile.c.V.removeManagedListener(b,c,a);
}
}
};

tactile.page=(function(){
    var a=function(){
        var d=new tactile.foundation.Observer();
        this.onready=function(e){
            d.subscribe(e);
        };
        
        this.inits=[];
        var c=this;
        function b(){
            c.inits.forEach(function(e){
                e.call(window);
            });
            c.init=function(e){
                e.call(window);
            };
        
    }
    tactile.EventManager.addDomReadyListener(function(){
        b();
        tactile.c.D.screen.updateOrientation();
        d.fire();
        tactile.foundation.LayoutManager.init();
    });
    tactile.EventManager.addResizeListener(tactile.c.D.screen.updateOrientation);
};

a.extend({
    getComponent:function(b){
        if(tactile.foundation.UIComponent.components[b]){
            return tactile.foundation.UIComponent.components[b];
        }else{
            var c=document.getElementById(b);
            if(c){
                return new tactile.foundation.UIElement(c);
            }else{
                return null;
            }
        }
    },
isComponent:function(b){
    if(tactile.foundation.UIComponent.components[b]){
        return true;
    }else{
        return false;
    }
},
init:function(b){
    this.inits.push(b);
},
add:function(b){
    if(b instanceof tactile.Layout){
        var c=document.getFirstBodyChild();
        if(c&&b.elem){
            c.appendChild(b.elem);
            tactile.foundation.LayoutManager.updateLayout();
        }
    }else{
    throw new tactile.errors.TypeError("tactile.page.add","tactile.Layout",typeof b);
}
},
remove:function(b){
    if(b instanceof tactile.Layout){
        if(b.elem){
            b.elem.parentNode.removeChild(b.elem);
            if(tactile.foundation.UIComponent.components[b.id]){
                delete tactile.foundation.UIComponent.components[b.id];
                tactile.foundation.LayoutManager.updateLayout();
            }
        }
    }else{
    throw new tactile.errors.TypeError("tactile.page.remove","tactile.Layout",typeof b);
}
}
});
return new a();
})();
if(tactile.Device.platform==="ios"){
    window.addEventListener("load",function(){
        document.addEventListener("touchmove",function(a){
            tactile.page.isClick=false;
        },false);
        tactile.c.U.fixLinks();
    },false);
}
